A Powershell script uses the “net use” command to map a shared folder.
The command look like the following:
$out = net use z: “\\192.168.1.1\share1” /user:$myuser $mypassword 2>&1
If the command fails, $out contains the following error (I’m afraid, it’s Italian, but the meaning is “Impossible to locate the name in the network”):
net.exe : Errore di sistema 67. In riga:77 car:19 + $out = net <<<&1 + CategoryInfo : NotSpecified: (Errore di sistema 67.:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError Impossibile trovare il nome della rete.
How can I save in two variables the meaningful informations, that are:
Errore di sistema 67 Impossibile trovare il nome della rete
Regards
marius