Here is an example of how I use the Write-Output command to log every update my PowerShell script made. The $output variable needs to wrap the collection of items being updated (the foreach statement) if you want to combine all outputs into the same file. Then use the Write-Output function to state what needs to logged.
One of my users was constantly getting locked out of his own documents. Upon saving a document, he would receive the following error: "The file "filename" is locked for exclusive (or shared) use by "his username"" The issue was that his user only had "contribute" permissions. While that should be enough, he needed "edit" permissions to avoid … Continue reading Unlock Documents With PowerShell
Sometimes your users don't need to see every single SharePoint library when they're in file explorer. Here is a bit of PowerShell that will hide necessary libraries from file explorer. Make sure you change the URL to your SharePoint site's URL and the folder name to the library you want to hide.