networktest passed

This commit is contained in:
Karl-Wilfried Zimmer 2024-07-14 19:03:07 +02:00
parent b243ac2a36
commit 9d9daa33a9

View File

@ -58,17 +58,22 @@ if($PSBoundParameters.ContainsKey("ProjectName")){
$folder = New-Item -Path $projPath -ItemType Directory $folder = New-Item -Path $projPath -ItemType Directory
$ReadTarget = $acls | Where-Object Name -Match ".*RW" $ReadTarget = $acls | Where-Object Name -Match ".*-RW"
$WriteTarget = $acls | Where-Object Name -Match ".*RO" $WriteTarget = $acls | Where-Object Name -Match ".*-RO"
Write-Host $ReadTarget.Name
Write-Host $WriteTarget.Name
$Parameters = @{ $Parameters = @{
Name=$ProjectName Name=$ProjectName
Path=$projPath Path=$projPath
} }
$share = New-SmbShare @Parameters $share = New-SmbShare @Parameters
$share|Set-SmbShare -FolderEnumerationMode AccessBased $share|Set-SmbShare -FolderEnumerationMode AccessBased
$share|Grant-SmbShareAccess -AccountName $ReadTarget.Name -AccessRight Read
$share|Grant-SmbShareAccess -AccountName $WriteTarget.Name -AccessRight Change
return $ret return $ret
} }