Thursday, May 16, 2024

Force Invoke-Webrequest to use TLS 1.2

Today, I needed to force an Invoke-WebRequest command to use TLS 1.2 to test access to Azure Key Vault. I ran the command below to force it:

[Net.ServicePointManager]::SecurityProtocol =[Net.SecurityProtocolType]::Tls12


And, here's the Invoke-WebRequest command I was using for testing:

$(Invoke-WebRequest -UseBasicParsing -Uri https://your-key-vault-name/healthstatus).Headers

No comments:

Post a Comment

Little script to see the backup history

 Today, I was teaching a co-worker how to create a copy only backup of a SQL Managed Instance database.  And I came up to use this script t...