Basic PowerShell Script, Check If File Exists

Опубликовано: 19 Март 2026
на канале: PowerHack
941
22

Learn the basics of PowerShell scripting with these quick, practical examples! From checking file existence to monitoring services, these tutorials are perfect for beginners and those looking to automate tasks with PowerShell. Each video shows you how to create simple scripts to boost productivity and streamline your workflows.

param (
[string]$Path = "C:\Temp\test.txt" #Default
)

if (Test-Path $Path) {
Write-Output "File exists!"
} else {
Write-Output "File not found"
}