Skip to content

Commit f1f43ab

Browse files
committed
Removed privilege actions
1 parent 8e6c4bf commit f1f43ab

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

functions/image/New-PSDCImage.ps1

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -374,24 +374,10 @@
374374
# Check if computer is local
375375
if ($computer.IsLocalhost) {
376376
$null = New-Item -Path $accessPath -ItemType Directory -Force
377-
$acl = Get-Acl -Path $accessPath
378-
$accessRule = New-Object System.Security.AccessControl.FilesystemAccessrule("Everyone", "FullControl", "ContainerInherit,ObjectInherit", "None", "Allow")
379-
$acl.SetAccessRule($accessRule)
380-
Set-Acl -Path $accessPath -AclObject $acl
381377
}
382378
else {
383379
$command = [ScriptBlock]::Create("New-Item -Path $accessPath -ItemType Directory -Force")
384380
$null = Invoke-PSFCommand -ComputerName $computer -ScriptBlock $command -Credential $DestinationCredential
385-
386-
[string]$commandText = "`$acl = Get-Acl -Path $accessPath
387-
`$accessRule = New-Object System.Security.AccessControl.FilesystemAccessrule(`"Everyone`", `"FullControl`", `"ContainerInherit,ObjectInherit`", `"InheritOnly`", `"Allow`")
388-
`$acl.SetAccessRule(`$accessRule)
389-
Set-Acl -Path $accessPath -AclObject `$acl
390-
"
391-
392-
$command = [scriptblock]::Create($commandText)
393-
394-
$null = Invoke-PSFCommand -ComputerName $computer -ScriptBlock $command -ArgumentList $accessPath -Credential $DestinationCredential
395381
}
396382
}
397383
catch {

0 commit comments

Comments
 (0)