Check if Enough Free Space in Remote Computer with PowerShell

Guillermo Musumeci
1 min readJan 22, 2021

--

I’m currently writing lots of building blocks of code to deploy Infrastructure as Code (IaC).

The following code can check if there enough space (in this case, 10 GB of space) on the C drive of the computer kopidc01:

$computer = "kopidc01"
$RequiredSpaceGB = 10
$FreeSpaceGB = [int]((Get-CimInstance -ComputerName $computer…

--

--

Guillermo Musumeci

Certified AWS, Azure & GCP Architect | HashiCorp Ambassador | Terraform SME | KopiCloud Founder | ex-AWS | Entrepreneur | Book Author | Husband & Dad of ✌