I have the following method to verify the presence of a file in a remote folder where I need to check the date of the file must be the current date.
If I execute the below statement it seems to work
$Exs = Test-Path '\\srvcld\Homeware\Applications\Processed\Soc*' -NewerThan (Get-Date -UFormat "%d/%m/%Y")
But when it run in the entiere script it returns the following error:
Test-Path : Cannot bind parameter 'NewerThan'. Cannot convert value "02/23/2018" to type "System.DateTime". Error: "String was not recognized as a valid DateTime."
Do you know another method that could be used to verify the existence of the files from the current date?