• General IT,  IT,  Microsoft 365,  PowerShell,  Sharepoint

    Powershell Script to Copy Files from a Microsoft 365 Sharepoint location to a local drive

    I need to move a large folder of images from Sharepoint Online to a local server for a customer as the online location is not working for their business needs. I tried to use the SharePoint download feature but the zip file reports that it is invalid. I decided to look into PowerShell and see if that could be used to export the files and folders. Here is the code I ended up with. Feel free to copy and paste the following into Powershell, update the variables and save it. This script is provided as an example and I am not responsible for any problems you may get or any…

  • General IT,  How To,  PowerShell,  Support

    Powershell script for moving files

    I needed to move a large number of files from one directory into an archive every month and only files over one month old. Although this, in itself, is not a hard task, I wanted to automate it in a script and thought it was time to learn a bit of Powershell. Let me take through the steps I took to build the final 1 line script. Lets get started The first part of the command is to get a list of files in the folder. I found the command I needed was Get-Childitem. Get-Childitem -Path "C:\CurrentPath\" -Recurse This scans the folder in C:\CurrentPath and gets a list of files.…