Hi Team,
I have a script to access shared director but its not working I getting error "Failed to add a new network location from "
Can you help me on this the code is given below
what does if (!("Z:" | %{Test-Path "$($_)" -pathType Container})) mean
thanks
Raees
#Access SQL Server package from shared directory
if ($MSSQL_SETUP_LOCATION_ACCESS_USER -eq "") {
net.exe use Z: $MSSQL_SETUP_LOCATION
} else {
net.exe use Z: $MSSQL_SETUP_LOCATION $MSSQL_SETUP_LOCATION_ACCESS_PASSWORD /user:$MSSQL_SETUP_LOCATION_ACCESS_USER
}
#Check the SQL Server 2012 Enterprise Edition installation files
if (!("Z:" | %{Test-Path "$($_)" -pathType Container})) {
echo "Failed to add a new network location from $MSSQL_SETUP_LOCATION."
Exit 1
}
if (!("Z:\setup.exe" | %{Test-Path "$($_)" -pathType Leaf})) {
echo "Cannot find the setup.exe file of SQL Server 2012 Enterprise Edition."
Exit 1
}