Workaround: ‘sqlps’ and "Test-Path" PowerShell cmdlet on a UNC path

Related Forum thread: http://social.msdn.microsoft.com/Forums/en-US/sqlsmoanddmo/thread/719ede23-9f1a-43f5-8c4e-8188fea0b19f/ Related Connect feedback: https://connect.microsoft.com/SQLServer/feedback/details/768743/sql-server-2012-import-module-sqlps-breaks-the-test-path-powershell-cmdlet Issue:When Test-Path cmdlet is run in SQL Powershell from the context of SQL Powershell provider path, Test-Path returns False. We see the same behavior with Registry Window Powershell provider as well Workaround:Specify literal path while using Test-Path cmdletExample:test-path -literalpath “FileSystem::\\machine\uncpath” References:http://mcpmag.com/articles/2011/05/16/handling-errors-scripts-test-path.aspxhttp://msdn.microsoft.com/en-us/library/windows/desktop/ee126188(v=vs.85).aspx

1