From 9d9daa33a979f169836389fb8a5afad8a2b1a036 Mon Sep 17 00:00:00 2001 From: Karl-Wilfried Zimmer Date: Sun, 14 Jul 2024 19:03:07 +0200 Subject: [PATCH] networktest passed --- NewProject.ps1 | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/NewProject.ps1 b/NewProject.ps1 index 1000567..d2d88ab 100644 --- a/NewProject.ps1 +++ b/NewProject.ps1 @@ -58,17 +58,22 @@ if($PSBoundParameters.ContainsKey("ProjectName")){ $folder = New-Item -Path $projPath -ItemType Directory - $ReadTarget = $acls | Where-Object Name -Match ".*RW" - $WriteTarget = $acls | Where-Object Name -Match ".*RO" + $ReadTarget = $acls | Where-Object Name -Match ".*-RW" + $WriteTarget = $acls | Where-Object Name -Match ".*-RO" + Write-Host $ReadTarget.Name + Write-Host $WriteTarget.Name $Parameters = @{ Name=$ProjectName Path=$projPath } + + $share = New-SmbShare @Parameters $share|Set-SmbShare -FolderEnumerationMode AccessBased - + $share|Grant-SmbShareAccess -AccountName $ReadTarget.Name -AccessRight Read + $share|Grant-SmbShareAccess -AccountName $WriteTarget.Name -AccessRight Change return $ret }