test -path "c:\Temp" -ComputerName sem1
function test(
[ValidateNotNullOrEmpty()] $path)
{
"Entered Name: $path"
/*
below $path is set as d:\TDL, this is default location, in case user defined path user is not give then it should connect d:\TDL
*/
--
if (!(Split-Path $path -IsAbsolute))
{
Write-Error "path is not absoulate"
}
else
{
Split-Path $path -Resolve $true /*or set-location (split-path -Resolve $true)*/
/*
2nd attemp onwards this test function running fine and connecting any path
only 1st attempt it is not connecting user defined path and connect absoulate path D:\TDL
*/
}
}
what should I give in else statment to connet user defined path right from 1st attempt to sem1, if same function next time run in loop for sem2 sem3 computers it is picking up userdefined path only 1st attempt have an issue