powershell - Cannot bind argument to parameter 'Path' because it is null: but I can't spot the error -
powershell - Cannot bind argument to parameter 'Path' because it is null: but I can't spot the error -
this code dont know need supply:
$serverlist = get-content "c:\users\munjanga\desktop\execute\testing\servers.txt" $serverlist $header="folderpath,identityreference,accesscontroltype,isinherited,inheritedflags,propagationflags" add-content -value $header -path $output foreach ($server in $serverlist) { $output = "\\$server\c:\users\munjanga\desktop\execute\testing $server.output.csv" del $output -erroraction silentlycontinue $rootpath ="\\$server\c:\system.sav" $folders = dir $rootpath -recurse | {$_.psiscontainer -eq $true} -erroraction silentlycontinue add-content -value "$header" -path $output foreach ($folder in $folders){ $acls = get-acl $folder.fullname | foreach-object { $_.access } foreach ($acl in $acls){ $outinfo = $folder.fullname + "," + $acl.identityreference + "," + $acl.accesscontroltype + "," + $acl.isinherited + "," + $acl.inheritanceflags + "," + $acl.propagationflags add-content -value $outinfo -path $output -erroraction silentlycontinue } } }
in line 4 invoking add-content cmdlet, requires passed -path, trying utilize $output, empty (null) variable.
assuming getting warning on line 12 when calling where-object? looks trying directory listing on unc path doesnt exist, getting nil pipe where. \$server\c:\system.sav supposed admin share la \$server\c$\system.sav ?
powershell
Comments
Post a Comment