Skip to content

Instantly share code, notes, and snippets.

@KennethBates
Created September 21, 2017 01:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KennethBates/4d885cdf7f3adc6f738c7934e769b360 to your computer and use it in GitHub Desktop.
Save KennethBates/4d885cdf7f3adc6f738c7934e769b360 to your computer and use it in GitHub Desktop.
#The -IncludeUsage switch will populate $VariableSet.Usage with the name of the projects using the LVS
#If -IncludeUsage is not passed, .usage will always be empty
Set-OctopusConnectionInfo -Server http://OctoServer -ApiKey API-XXX
$VariableSets = Get-OctopusVariableSet -LibrarySetName * -IncludeUsage
foreach($VariableSet in $VariableSets){
Write-Output "`nVariable set [$($VariableSet.LibraryVariableSetName)] is being used by projects"
foreach($project in $VariableSet.Usage){
"--$project"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment