Vinod, when you post code or error messages or sample data or console output format it as code, please.
In the “Text” view you can use the code tags “PRE”, in the “Visual” view you can use the format template “Preformatted”. You can go back edit your post and fix the formatting - you don’t have to create a new one.
Thanks in advance.
What’s the complete error message? If you have more than one mapped drive you have to format the output to fit to a RegSz value or you have to change the registry key type.
New-ItemProperty : The input object cannot be bound to any parameters for the command either because the command does
not take pipeline input or the input and its properties do not match any of the parameters that take pipeline input.
At line:1 char:70
You’re piping both name and providername new-itemproperty, but there’s no -providername parameter, and you’re using -name a second time. You can only use $_ inside a scriptblock. I don’t know what DriveMap is. This way, I’m turning the providername property into a value property.