Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

Powershell- Stop Script in IF Statement

$
0
0
if (test-path ){
    (Perform some actions here)
}
else
{
Write-Host "FILE NOT FOUND!"
exit
}


Trying to stop a script if a file is missing (or any other conditions)...

The above does not work.

Any suggestions?


Viewing all articles
Browse latest Browse all 15370


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>