PowerShell tips This note was created on 2023-03-20 This note was last edited on 2024-04-02 Disable telemetry (pwsh, GNU/Linux): $ echo 'export POWERSHELL_TELEMETRY_OPTOUT=1' >> .profile Disable telemetry (Powershell, MS Windows): $ notepad $PSHOME\Profile.ps1 Add: ~~~ POWERSHELL_TELEMETRY_OPTOUT=true ~~~ Get and enable execution of PowerShell scripts: $ Get-ExecutionPolicy $ Set-ExecutionPolicy RemoteSigned # (other options: Restricted, Unrestricted) Get PowerShell version: $ $PSVersionTable.PSVersion Make API call with bearer token auth: $ $exampleEmailParameter = ("test@example.com").Replace("@", "%40") $ $bearerToken = "XXXXXX" $ Invoke-WebRequest -Authentication Bearer -Token (ConvertTo-SecureString -AsPlainText -String $bearerToken -Force) -Method Get -Uri "https://api.example.com/api/v1/example?contactEmail=$exampleEmailParameter)" Note: use "-AllowUnencryptedAuthentication" if API available only on HTTP.