Permission errors in PowerShell -
i new powershell. when trying write simple script deletes contents of folder , fills files copied different folder, permissiondenied
error.
details:
+ remove-item <<<< d:\path\* -recurse + categoryinfo : permissiondenied: (save.gif:fileinfo) [remove-item], ioexception + fullyqualifiederrorid : removefilesystemitemunauthorizedaccess,microsoft.powershell.commands.removeitemcommand
where problem? able manipulate both folders through explorer. error occurs both when running script file , shell (using windows powershell ise). ise process runs under account. i'm running windows 7 professional , local administrator.
edit: after richard's suggestion, tried verbose mode (which seemed have no effect).
ps z:\> $error[0] | fl * -force psmessagedetails : exception : system.io.ioexception: not enough permission perform operation. targetobject : d:\path\file.txt categoryinfo : permissiondenied: (d:\path\file.txt:fileinfo) [remove-item], ioexception fullyqualifiederrorid : removefilesystemitemunauthorizedaccess,microsoft.powershell.commands.removeitemcommand errordetails : cannot remove item d:\path\file.txt: not enough permission perform operation. invocationinfo : system.management.automation.invocationinfo pipelineiterationinfo : {0, 1}
i don't see of use there (but tips anyway).
edit 2: okay, here's script source:
remove-item d:\path_a\* -recurse copy-item d:\path_b\* d:\path_a\
that's it. remove-item seems throw @ every file.
is uac enabled? if try running powershell session 'administrator'. looks don't have permission delete objects.
we have restrictive security policies work , users not familiar uac burned time.
Comments
Post a Comment