Is there something I did wrong or Is it designed to act like that?
=======================================================
C:\WINDOWS> new-item . -Name my.txt -type "file"
new-item : Access to the path 'C:\WINDOWS\my.txt' is denied.
At line:1 char:9
+ new-item <<<< . -Name my.txt -type "file"
=======================================================
C:\WINDOWS> new-item . -Name my.txt -type "file" -Credential Admin
Credential Information
Please enter your credentials.
Password for user Admin: ******
new-item : Dynamic parameters for the Cmdlet cannot be retrieved.
Invocation of
MakePath on the 'FileSystem' provider failed for path 'C:\'. Cannot
call metho
d. The provider does not support the use of credentials.
At line:1 char:9
+ new-item <<<< . -Name my.txt -type "file" -Credential Admin
=======================================================
C:\WINDOWS> $me=get-credential
Cmdlet get-credential at command pipeline position 1
Supply values for the following parameters:
Credential
User: Admin
Password for user Admin: ******
C:\WINDOWS> new-item . -Name my.txt -type "file" -Credential $me
new-item : Dynamic parameters for the Cmdlet cannot be retrieved.
Invocation of
MakePath on the 'FileSystem' provider failed for path 'C:\'. Cannot
call metho
d. The provider does not support the use of credentials.
At line:1 char:9
+ new-item <<<< . -Name my.txt -type "file" -Credential $me
=========================================================
Abhishek Agrawal [MSFT]
MSH Team
Microsoft Corporation
This posting is provided "AS IS" with no warranties, and confers no rights.
"TonyDeSweet" <shenzh...@gmail.com> wrote in message
news:1139107835....@o13g2000cwo.googlegroups.com...