I placed the PostDeploy.ps1 script in the root directory of my package. The script was to modify a subdirectories permissions to add “Everyone” , set permission level to “FullControl”, set allow\deny to “Allow”. The script never executed and the file was not deleted from the directory after deployment. Nothing worked…
The script is:
$folderPath=($OctopusOriginalPackageDirectoryPath + “\downloads”)
$userName =“Everyone”
$controlLevel=“FullControl”
$allowDeny=“Allow”
Write-Host “FolderPath: $folderPath”
Write-Host “UserName: $userName”
Write-Host “ControlLevel: $controlLevel”
Write-Host “AllowDeny: $allowDeny”
$Acl = Get-Acl $folderPath
$Ar = New-Object system.security.accesscontrol.filesystemaccessrule($userName,$controlLevel,$allowDeny)
$Acl.SetAccessRule($Ar)
Set-Acl $folderPath $Acl
Write-Host “download directory permissions set”
I have set the log-in for the service to an Admin level on the server.
Also, when I execute the script in Powershell everything works great.
With Tentacle, only the user gets created, no permissions get set… I have no clue about making this work…
Any help here would be appriciated…
PostDepoly.ps1 (828 Bytes)