A Powershell script uses the "net use" command to map a shared folder.
$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
So, that error is just a big string, which means you're going to have to parse it out yourself. You could start by seeing if $out and $out returned what you wanted.
You must be logged in to reply to this topic.