[Solved] Terraform Error accessing remote module registry in PowerShell

If you are using PowerShell and trying to run a terraform init, you may get an error as follows: Error: error accessing remote module registry Failed to retrieve available versions for module ... from registry.terraform.io: Failed to request discovery document: Get "https://registry.terraform.io/.well-known/terraform.json": read tcp x.x.x.x:xxxx->x.x.x.x: wsarecv: An existing connection was forcibly closed by the remote host.. Note that you will still be able to make a successful curl request, but terraform will fail!...

May 23, 2022 · 1 min · 127 words · Andrew

How to Recursively Delete a Directory in PowerShell

If you want to recursively delete a directory/folder using PowerShell, then you have 2 options. Option 1 – With LiteralPath and Force Remove-Item -LiteralPath "myFolder" -Force -Recurse Option 2 – With implicit and Recurse Remove-Item myFolder/* -Recurse

May 22, 2022 · 1 min · 37 words · Andrew

How to Install Chocolatey on Windows PowerShell

Chocolatey is a software management automation for Windows that wraps installers, executables, zips, and scripts into compiled packages chocolatey.org How to Install Chocolatey in PowerShell Open PowerShell (Run PowerShell in Administrator mode) and paste the following script: Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) This will install Chocolatey, and get you to the point of being able to install packages. Install some Packages with Chocolatey Some example packages to install:...

December 6, 2021 · 1 min · 98 words · Andrew

How to run PowerShell in Administrator Mode

Some PowerShell commands require elevated permissions to complete. To do this, you must first open PowerShell in Administrator Mode. Steps to Run PowerShell as an Administrator Click Start (super key) Type powershell Right-click on Windows PowerShell and select Run as administrator or; Select Run as Administrator from the right-hand-side menu. Run as Administrator The application will now be started in Administrator Mode.

December 5, 2021 · 1 min · 62 words · Andrew