PowerShell: Invoke-RestMethod vs Invoke-WebRequest
Was talking with some engineers the other day and the question came up of the differences between Invoke-RestMethod vs Invoke-WebRequest and which cmdlet to use when. Some detailed information from Billy York, but the short answer is: REST for well-formed objects, WebRequest for html. Specifically Rest-Method is intended for REST endpoints (JSON, XLM, etc.) and can
FieldNote: Secure password in file?
Sometimes you must store a password for an account in a PowerShell script file. One option is to leverage the ConvertTo-SecureStringcmdlet. By running this cmdlet on a machine, with a specific password, a secure string is generated. You put that value into your file, and then you can run a ConvertFrom-SecureSting to run the script securely. However, I