Hi ,
I have made a short script NoPLMAccess.ps1 , which should list all
directories on a specific shre, that do not have aceesstrings where the
domainname occurs.
ndr user filesystem \myserver\myshare
Get-Item user:* |
|Get-Acl | Where-object {-not ($_.accesstostring -like "*MyDomain*") } |
format-table PSchildname,accesstostring -AutoSize -wrap
The funny thing is, it works, when you type in these commands directly into
the Powershell console, if you invoke the script, however, by
.\NoPLMAccess
an error
out-lineoutput : Object of type
"Microsoft.PowerShell.Commands.Internal.Format.FormatStartData" is not legal
or not in
the correct sequence. This is likely caused by a user-specified
"format-table" command which is conflicting with the de
fault formatting. is the result.
if you source the script
.. .\NoPLMAccess
the script works and format processing is done as requested.
Is there any explanation for that ?


