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 }