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

Checking Backup File Date Before Restoring

 Today, I got an interesting request.  I had to check a restore job for a data warehouse analyst.  He said the database wasn't restored ...