'If statements in Powershell
I want to check if file.txt exists. If it exists delete it and reinstall it. If it does not exist download it.
Test-Path -Path file.txt -PathType Leaf
Remove-Item 'file.txt'
Invoke-WebRequest -Uri http://example.com/file.txt -OutFile file.txt
I can't seem to figure out how to put this into an if statement (I am new to Powershell).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
