PowerShell try/catch Is Not Catching Your Error
Most cmdlet errors are non-terminating, so try/catch never sees them. Why -ErrorAction Stop is the whole trick, why Write-Error is not throw, and why try/catch does nothing at all for robocopy or git.
Most cmdlet errors are non-terminating, so try/catch never sees them. Why -ErrorAction Stop is the whole trick, why Write-Error is not throw, and why try/catch does nothing at all for robocopy or git.
Five things produce this error and only one is fixed by Set-ExecutionPolicy. The scope that is actually winning, the mark of the web that makes RemoteSigned refuse a file, and why fixing it in PowerShell 5.1 does nothing for PowerShell 7.
Your script asks for a column by the name on screen and gets an empty string back. Every column has two names, renaming never changes the one that matters, and Created By is called Author.