Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

powershell if file exists

# Check if file doesn't exists
if (-not(Test-Path -Path "$directory/$file" -PathType Leaf)) {
	# File doesn't exist
}

# Check if file does exists
if (Test-Path -Path "$directory/$file" -PathType Leaf) {
	# File does exist
}
Source by adamtheautomator.com #
 
PREVIOUS NEXT
Tagged: #powershell #file #exists
ADD COMMENT
Topic
Name
5+8 =