This PowerShell script recalls files from an Azure storage system by checking file availability and triggering a recall process if necessary. It supports scanning directories recursively and handling wildcard paths.
The script can be executed using PowerShell or Windows CMD. You can specify either:
- A RootFolder to scan all files in a directory.
- A PathList file containing specific paths or wildcard patterns.
- Both RootFolder and PathList together.
This will scan all files recursively in the specified directory:
\\Path\To\RecallFiles.ps1 -RootFolder "\\Path\To\DataFolder"powershell -File \\Path\To\RecallFiles.ps1 -RootFolder "\\Path\To\DataFolder"If you have a text file containing a list of file paths or wildcard patterns, specify it using -PathList.
\\Path\To\RecallFiles.ps1 -PathList "\\Path\To\pathlist.txt"powershell -File \\Path\To\RecallFiles.ps1 -PathList "\\Path\To\pathlist.txt"You can combine both options to prepend the specified directory path to relative paths or wild cards specified in the PathList:
\\Path\To\RecallFiles.ps1 -PathList "\\Path\To\pathlist.txt" -RootFolder "\\Path\To\DataFolder"powershell \\Path\To\RecallFiles.ps1 -PathList "\\Path\To\pathlist.txt" -RootFolder "\\Path\To\DataFolder"By default, logs are saved as RecallFiles.log in the script's directory. You can specify a custom log file location:
\\Path\To\RecallFiles.ps1 -RootFolder "\\Path\To\DataFolder" -LogFile "\\Path\To\output.log"powershell \\Path\To\RecallFiles.ps1 -RootFolder "\\Path\To\DataFolder" -LogFile "\\Path\To\output.log"- The script supports wildcard characters (
*,?) in file paths within the-PathListfile. - If both
-PathListand-RootFolderare specified,-PathListtakes precedence but will still scan under-RootFolderif paths are relative. - Long UNC paths are automatically converted if they exceed 260 characters.
Example of a pathlist.txt file:
*.tif
Subfolder\*.jpg
SpecificFile.txt
This would:
- Match all
.tiffiles in the specified-RootFolder. - Match all
.jpgfiles inSubfolder. - Check for
SpecificFile.txtin the-RootFolder.