I am trying to run the PowerShell command Test-Path in VBA. But I cannot get it to work. I want to check if a file exists on a remote computer or on a NAS. The DIR function does not work. Here is the VBA code that I am using.
Dim boolFileExists as Boolean
boolFileExists = "PowerShell -Command ""{Test-Path 'D:\Data\Exercise\Chair Workouts.docx'}"""
Thank you