Not enough free storage crashes Powershell
I was trying to install GHCUP via this command: Set-ExecutionPolicy Bypass -Scope Process -Force;[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072;Invoke-Command -ScriptBlock ([ScriptBlock]::Create((Invoke-WebRequest https://www.haskell.org/ghcup/sh/bootstrap-haskell.ps1 -UseBasicParsing))) -ArgumentList $true and Powershell would crash as soon as the command was put in.
I made sure to run a user session of Powershell and even tried turning off my antivirus and firewall so it would stop crashing but nothing helped. Turns out in the end it was a storage issue as I only had 3 gbs of free storage and once I freed up some gbs it worked like a charm but that doesn't explain the crashing.
I am not part of any workgroups and I am using a personal laptop running windows 10 and Powershell 5.1.