I Practiced What I Preach Today
I like the concept of using scripting to save myself the trouble of repetitive tasks. As I was going through unzipping files and copying them over to another folder, I had a thought that I could probably do it in PowerShell really easily. Here is the process:
- Unzip a .zip file to a specific directory
- Move the original .zip file to a “done” folder
- Wait 60 seconds (to give it time to upload to the cloud)
This process is the culmination of moving from CCH/Wolters Kluwer “Portal” (File sharing solution) to Citrix Sharefile. We have like 500 “portals” which came down as individual .zip files. This process made things MUCH easier on me, I’m just going to start it at the end of the day and let it run over night. Sweet!
$ClientFiles = Get-ChildItem -Path ‘
' -Filter *.zip $ClientFiles | ForEach-Object { $path = [IO.Path]::GetFileNameWithoutExtension($.Name) echo “Expanding and uploading $path” # Expand File, Output to ShareFile Drive Expand-Archive -Path $.FullName -DestinationPath “
\$_path\" # Move archive to Uploaded folder Move-Item -Path $_.FullName -Destination ‘
echo “Sleeping 60 seconds…” Start-Sleep -s 60 }
By the way, I’m counting this as my daily “Make a little something every day”.