Converting the FileSystemObject's FileExists Method

Definition: Returns True if the specified file exists.

FileExists

This is easy in PowerShell, simply call the Test-Path cmdlet, passing it the name of the file you’re checking for:

Test-Path C:\Scripts\Test.txt

See conversions of other FileSystemObject methods and properties.
Return to the VBScript to Windows PowerShell home page