PowerShell - File and Directory Operations
You wrote this script to check if a folder exists:
But it always prints 'Folder missing' even when the folder exists. What is the likely problem?
if (Test-Path -Path 'D:\Data') {
Write-Host 'Folder found'
} else {
Write-Host 'Folder missing'
}But it always prints 'Folder missing' even when the folder exists. What is the likely problem?
