Before installing octopus with support for spaces I had a powershell-script to retrieve the url for a specific machine. That doesn’t work anymore. Getting following error:
“You do not have permission to perform this action. Please con
tact your Octopus administrator. Missing permission: MachineView”
I think I need to use constructor something like this:
new OctopusRepository(endpoint, RepositoryScope.ForSpace(space)); (this is c#) and works fine.
Not sure how to do this in Powershell.
Have added the powershell:
Add-Type -Path ‘C:\Program Files\Octopus Deploy\Tentacle\Octopus.Client.dll’
$apikey = ‘API-somesecret’ #admin user
$octopusURI = ‘https://somesecret.url’ # Your server address
$spaceid = “somespacename”
$endpoint = New-Object Octopus.Client.OctopusServerEndpoint $octopusURI,$apikey
$repository = New-Object Octopus.Client.OctopusRepository $endpoint
$space = $repository.Spaces.FindByName($spaceid)
if (!$space) {
throw “Could not find space”
} else {
Write-Output “Is not null”
}
$repository = New-Object Octopus.Client.OctopusRepository $endpoint , RepositoryScope.ForSpace($space) //something like this…
The last line must be changed to something similar, I guess