full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xComputerManagement/Examples/Sample_xScheduledTask.ps1 | Sample_xScheduledTask.ps1 | configuration Sample_xScheduledTask
{
param
(
[string[]]$NodeName = 'localhost'
)
Import-DSCResource -ModuleName xComputerManagement
Node $NodeName
{
xScheduledTask MaintenanceScriptExample
{
TaskName = "Custom maintenance tasks"
Action... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xComputerManagement/Examples/Sample_xPowerPlan.ps1 | Sample_xPowerPlan.ps1 | <#
.SYNOPSIS
Example to set a power plan.
.DESCRIPTION
This examples sets the active power plan to the 'High performance' plan.
#>
Configuration Sample_xPowerPlan
{
param
(
[Parameter()]
[String[]]
$NodeName = 'localhost'
)
Import-DSCRe... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xComputerManagement/Examples/Sample_xOfflineDomainJoin.ps1 | Sample_xOfflineDomainJoin.ps1 | configuration Sample_xOfflineDomainJoin
{
param
(
[string[]]$NodeName = 'localhost'
)
Import-DSCResource -ModuleName xComputerManagement
Node $NodeName
{
xOfflineDomainJoin ODJ
{
RequestFile = 'C:\ODJ\ODJBlob.txt'
IsSingleInstance = 'Ye... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xComputerManagement/Tests/Unit/MSFT_xScheduledTask.Tests.ps1 | MSFT_xScheduledTask.Tests.ps1 | [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")]
param(
)
$Global:DSCModuleName = 'xComputerManagement'
$Global:DSCResourceName = 'MSFT_xScheduledTask'
#region HEADER
# Unit Test Template Version: 1.1.0
[String] $moduleRoot = Split-Path -Parent... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xComputerManagement/Tests/Unit/MSFT_xComputer.Tests.ps1 | MSFT_xComputer.Tests.ps1 | $Global:DSCModuleName = 'xComputerManagement'
$Global:DSCResourceName = 'MSFT_xComputer'
#region HEADER
[String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))
if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResource.T... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xComputerManagement/Tests/Unit/MSFT_xOfflineDomainJoin.tests.ps1 | MSFT_xOfflineDomainJoin.tests.ps1 | $Global:DSCModuleName = 'xComputerManagement'
$Global:DSCResourceName = 'MSFT_xOfflineDomainJoin'
#region HEADER
[String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))
if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCR... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xComputerManagement/Tests/Unit/MSFT_xPowerPlan.Tests.ps1 | MSFT_xPowerPlan.Tests.ps1 | $script:DSCModuleName = 'xComputerManagement'
$script:DSCResourceName = 'MSFT_xPowerPlan'
#region HEADER
# Unit Test Template Version: 1.2.0
$script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResour... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xComputerManagement/Tests/Integration/MSFT_xScheduledTask.Integration.Tests.ps1 | MSFT_xScheduledTask.Integration.Tests.ps1 | #Requires -Version 5.0
$Global:DSCModuleName = 'xComputerManagement'
$Global:DSCResourceName = 'MSFT_xScheduledTask'
#region HEADER
# Unit Test Template Version: 1.1.0
[String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))
if ( (-not (Test... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xComputerManagement/Tests/Integration/MSFT_xScheduledTask.Config.ps1 | MSFT_xScheduledTask.Config.ps1 | Configuration xScheduledTask_Add
{
Import-DscResource -ModuleName xComputerManagement
node "localhost" {
xScheduledTask xScheduledTask_Add {
TaskName = "Test task"
TaskPath = "\xComputerManagement\"
ActionExecutable = "C:\windows\system32\WindowsPowerShell\v1.0... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xActiveDirectory/Assert-HADC.ps1 | Assert-HADC.ps1 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingComputerNameHardcoded', '')]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')]
param()
# A configuration to Create High Availability Domain Controller
$secpasswd = ConvertTo-Secure... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xActiveDirectory/Assert-ParentChildDomains.ps1 | Assert-ParentChildDomains.ps1 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingComputerNameHardcoded', '')]
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')]
param()
$secpasswd = ConvertTo-SecureString "Adrumble@6" -AsPlainText -Force
$domainCred = New-Object... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xActiveDirectory/Misc/New-ADDomainTrust.ps1 | New-ADDomainTrust.ps1 | $Properties = @{
SourceDomain = New-xDscResourceProperty -Name SourceDomainName -Type String -Attribute Key `
-Description 'Name of the AD domain that is requesting the trust'
TargetDomain = New-xDscResourceProperty -Nam... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xActiveDirectory/DSCResources/MSFT_xADRecycleBin/Examples/xActiveDirectory_xADRecycleBin.ps1 | xActiveDirectory_xADRecycleBin.ps1 | Configuration Example_xADRecycleBin
{
Param(
[parameter(Mandatory = $true)]
[System.String]
$ForestFQDN,
[parameter(Mandatory = $true)]
[System.Management.Automation.PSCredential]
$EACredential
)
Import-DscResource -Module xActiveDirectory
Node $AllNodes.NodeName
{... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xActiveDirectory/DSCResources/MSFT_xADRecycleBin/ResourceDesignerScripts/GeneratexADRecycleBinSchema.ps1 | GeneratexADRecycleBinSchema.ps1 | New-xDscResource -Name MSFT_xADRecycleBin -FriendlyName xADRecycleBin -ModuleName xActiveDirectory -Path . -Force -Property @(
New-xDscResourceProperty -Name ForestFQDN -Type String -Attribute Key
New-xDscResourceProperty -Name EnterpriseAdministratorCredential -Type PSCredential -Attribute Required
New-... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xActiveDirectory/DSCResources/MSFT_xADCommon/MSFT_xADCommon.ps1 | MSFT_xADCommon.ps1 | data localizedString
{
# culture="en-US"
ConvertFrom-StringData @'
RoleNotFoundError = Please ensure that the PowerShell module for role '{0}' is installed
MembersAndIncludeExcludeError = The '{0}' and '{1}' and/or '{2}' parameters conflict. The '{0}' parameter should not be u... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xActiveDirectory/Tests/Unit/MSFT_xADDomain.Tests.ps1 | MSFT_xADDomain.Tests.ps1 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')]
param()
$Global:DSCModuleName = 'xActiveDirectory' # Example xNetworking
$Global:DSCResourceName = 'MSFT_xADDomain' # Example MSFT_xFirewall
#region HEADER
[String] $moduleRoot = Split-Path ... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xActiveDirectory/Tests/Unit/MSFT_xWaitForADDomain.Tests.ps1 | MSFT_xWaitForADDomain.Tests.ps1 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')]
param()
$Global:DSCModuleName = 'xActiveDirectory'
$Global:DSCResourceName = 'MSFT_xWaitForADDomain'
#region HEADER
[String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path ... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xActiveDirectory/Tests/Unit/MSFT_xADCommon.Tests.ps1 | MSFT_xADCommon.Tests.ps1 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')]
param()
$Global:DSCModuleName = 'xActiveDirectory' # Example xNetworking
$Global:DSCResourceName = 'MSFT_xADCommon' # Example MSFT_xFirewall
#region HEADER
[String] $moduleRoot = Split-Path ... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xActiveDirectory/Tests/Unit/MSFT_xADComputer.Tests.ps1 | MSFT_xADComputer.Tests.ps1 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')]
param()
$Global:DSCModuleName = 'xActiveDirectory' # Example xNetworking
$Global:DSCResourceName = 'MSFT_xADComputer' # Example MSFT_xFirewall
#region HEADER
# Unit Test Template Version: 1.... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xActiveDirectory/Tests/Unit/MSFT_xADDomainController.Tests.ps1 | MSFT_xADDomainController.Tests.ps1 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')]
param()
$Script:DSCModuleName = 'xActiveDirectory'
$Script:DSCResourceName = 'MSFT_xADDomainController'
#region HEADER
[String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $P... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xActiveDirectory/Tests/Unit/MSFT_xADOrganizationalUnit.Tests.ps1 | MSFT_xADOrganizationalUnit.Tests.ps1 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')]
param()
$Global:DSCModuleName = 'xActiveDirectory' # Example xNetworking
$Global:DSCResourceName = 'MSFT_xADOrganizationalUnit' # Example MSFT_xFirewall
#region HEADER
[String] $moduleRoot =... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xActiveDirectory/Tests/Unit/MSFT_xADGroup.Tests.ps1 | MSFT_xADGroup.Tests.ps1 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')]
param()
$Global:DSCModuleName = 'xActiveDirectory' # Example xNetworking
$Global:DSCResourceName = 'MSFT_xADGroup' # Example MSFT_xFirewall
#region HEADER
[String] $moduleRoot = Split-Path -... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xActiveDirectory/Tests/Unit/MSFT_xADUser.Tests.ps1 | MSFT_xADUser.Tests.ps1 | $Global:DSCModuleName = 'xActiveDirectory'
$Global:DSCResourceName = 'MSFT_xADUser'
#region HEADER
[String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path))
if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResource.Tests'... |
PowerShellCorpus/Github/carstendullmann_twodomainsdsc/DSC/xActiveDirectory/Tests/Unit/MSFT_xADDomainDefaultPasswordPolicy.Tests.ps1 | MSFT_xADDomainDefaultPasswordPolicy.Tests.ps1 | [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')]
param()
$Global:DSCModuleName = 'xActiveDirectory' # Example xNetworking
$Global:DSCResourceName = 'MSFT_xADDomainDefaultPasswordPolicy' # Example MSFT_xFirewall
#region HEADER
[String] $mod... |
PowerShellCorpus/Github/serlapoi_aubainerie/aubainerie/Scripts/deploy-azaub-presql01.ps1 | deploy-azaub-presql01.ps1 | <#
.SYNOPSIS
Deploys a template to Azure
.DESCRIPTION
Deploys an Azure Resource Manager template
.PARAMETER subscriptionId
The subscription id where the template will be deployed.
.PARAMETER resourceGroupName
The resource group where the template will be deployed. Can be the name of an... |
PowerShellCorpus/Github/serlapoi_aubainerie/aubainerie/Scripts/Deploy-AzureResourceGroup.ps1 | Deploy-AzureResourceGroup.ps1 | #Requires -Version 3.0
#Requires -Module AzureRM.Resources
#Requires -Module Azure.Storage
Param(
[string] [Parameter(Mandatory=$true)] $ResourceGroupLocation,
[string] $ResourceGroupName = 'aubainerie',
[switch] $UploadArtifacts,
[string] $StorageAccountName,
[string] $StorageContainerNam... |
PowerShellCorpus/Github/serlapoi_aubainerie/aubainerie/Scripts/deploy-aubainerie.ps1 | deploy-aubainerie.ps1 | <#
.SYNOPSIS
Deploys a template to Azure
.DESCRIPTION
Deploys an Azure Resource Manager template
.PARAMETER subscriptionId
The subscription id where the template will be deployed.
.PARAMETER resourceGroupName
The resource group where the template will be deployed. Can be the name of an... |
PowerShellCorpus/Github/spearsd_masslaunch/masslaunch.ps1 | masslaunch.ps1 | $wshell = New-Object -ComObject Wscript.Shell
$wshell.Popup("Welcome to Mass Launch! `n`nBy: Dustin Spears",0,"Mass Launch")
$path = Get-Location
[System.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') | Out-Null
$file = [Microsoft.VisualBasic.Interaction]::InputBox("Enter the file with compute... |
PowerShellCorpus/Github/OPSTest_E2E_NewRepo_1489983790807/.openpublishing.build.ps1 | .openpublishing.build.ps1 | param(
[string]$buildCorePowershellUrl = "https://opbuildstoragesandbox2.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1",
[string]$parameters
)
# Main
$errorActionPreference = 'Stop'
# Step-1: Download buildcore script to local
echo "download build core script to local with source u... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Deployment-Scripts/Powershell/AzureCSWaitForInstanceSwap.ps1 | AzureCSWaitForInstanceSwap.ps1 | # Loop until all instances are running
do {
$ready=0
$total=0
# query the status of the running instances
$list = (Get-AzureRole -ServiceName #{YourCloudService} -Slot Staging -InstanceDetails).InstanceStatus
# count the number of ready instances
$list | foreach-object { IF ($_ -eq "... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Deployments/PromoteRelease.ps1 | PromoteRelease.ps1 | # You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'
$apikey = 'API-xx' # Get this from your profile
$octopusURI = 'http://octopus' # Your Octopus Server address
$projectName = "Web" # Name of th... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Deployments/CancelQueued.ps1 | CancelQueued.ps1 | # You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'
$apikey = 'API-xxx' # Get this from your profile
$octopusURI = 'http://localhost' # Your Octopus Server address
$projectId = "Projects-x" # G... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Deployments/DeployRelease.ps1 | DeployRelease.ps1 | # You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'
$apikey = 'API-xxx' # Get this from your profile
$octopusURI = 'http://localhost' # Your Octopus Server address
$releaseId = "Releases-1" # G... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Releases/DeleteReleasesForProject.ps1 | DeleteReleasesForProject.ps1 | # You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'
$apikey = 'API-RKXKTNS8D7SDADKUUA0OHTMFSW' # Get this from your profile
$octopusURI = 'http://localhost' # Your server address
$projectId = "... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Releases/CreateRelease.ps1 | CreateRelease.ps1 | # You can get this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'
$apikey = 'API-MCPLE1AQM2VKTRFDLIBMORQHBXA' # Get this from your profile
$octopusURI = 'http://localhost' # Your server address
$projectI... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Lifecycles/CreateLifecycleWithPhase.ps1 | CreateLifecycleWithPhase.ps1 | # You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
#Add-Type -Path 'Octopus.Client.dll'
$apikey = '' # Get this from your profile
$octopusURI = '' # Your Octopus Server address
$endpoint = New-Object Octopus.Client.OctopusServer... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Tasks/RunHealthCheck.ps1 | RunHealthCheck.ps1 | ###CONFIG###
# You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path .\Octopus.Client.dll
$apikey = "" # Get this from your profile
$octopusURI = "" # Your server address
$Description = "Health check started from ... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Events/FindByDate.ps1 | FindByDate.ps1 | # You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'
$apikey = '' #Your API Key
$octopusURI = '' # Your server address
$endpoint = new-object Octopus.Client.OctopusServerEndpoint $octopusURI,$ap... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/ScriptModules/MigrateBetweenInstances.ps1 | MigrateBetweenInstances.ps1 | # You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
#Add-Type -Path 'Octopus.Client.dll'
#S prefix on variables stands for "Source"
$SApiKey = $env:OctopusAPIKey#'' # Get this from your profile
$SOctopusURI = $env:OctopusURL#'' # Y... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/DeploymentProcesses/UnwrapChildSteps.ps1 | UnwrapChildSteps.ps1 | # You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'
$octopusURI = "http://localhost" # Your server address
$apiKey = 'API-IQW9QGGWJE5T4KFVQLL15PUY' # Get this from your profile
$projectName = "Pro... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/DeploymentProcesses/ScopeRoleToStep.ps1 | ScopeRoleToStep.ps1 | # You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'
$apikey = 'API-MCPLE1AQM2VKTRFDLIBMORQHBXA' # Get this from your profile
$octopusURI = 'http://localhost' # Your server address
$projectName ... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/DeploymentProcesses/CreateScriptStep.ps1 | CreateScriptStep.ps1 | # You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'
$apikey = 'API-MCPLE1AQM2VKTRFDLIBMORQHBXA' # Get this from your profile
$octopusURI = 'http://localhost' # Your server address
$projectId = ... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/DeploymentProcesses/RemoveRoleFromAllSteps.ps1 | RemoveRoleFromAllSteps.ps1 | # You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'
$apikey = 'API-MCPLE1AQM2VKTRFDLIBMORQHBXA' # Get this from your profile
$octopusURI = 'http://localhost' # Your server address
$projectName ... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Projects/DeleteProjectsWithoutDeploymentProcess.ps1 | DeleteProjectsWithoutDeploymentProcess.ps1 | [CmdletBinding()]
Param(
[Parameter(Mandatory=$true,Position=1)]
[string]$OctopusUrl = "http://localhost:80",
[Parameter(Mandatory=$true,Position=2)]
[string]$ApiKey,
[Parameter(Mandatory=$false,Position=3)]
[switch]$Delete
)
Add-Type -Path "Octopus.Client.dll"
$endpo... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Projects/CreateProject.ps1 | CreateProject.ps1 | # You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'
$apikey = 'API-MYAPIKEY' # Get this from your profile
$octopusURI = 'http://MY-OCTOPUS' # Your server address
$projectName = "My project via ... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Teams/AddEnvironmentToTeam.ps1 | AddEnvironmentToTeam.ps1 | # You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'
$apikey = 'API-MCPLE1AQM2VKTRFDLIBMORQHBXA' # Get this from your profile
$octopusURI = 'http://localhost' # Your server address
$endpoint = n... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Machines/ListMachinesInDeployment.ps1 | ListMachinesInDeployment.ps1 | # You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'
$apikey = 'API-xxx' # Get this from your profile
$octopusURI = 'http://octopus' # Your server address
$endpoint = New-Object Octopus.Client.O... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Machines/DeleteMachinesByRole.ps1 | DeleteMachinesByRole.ps1 | # You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'
$apikey = 'API-MCPLE1AQM2VKTRFDLIBMORQHBXA' # Get this from your profile
$octopusURI = 'http://localhost' # Your server address
$role = "Demo... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Machines/RegisterListeningTentacle.ps1 | RegisterListeningTentacle.ps1 | # You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'
$apikey = 'API-xxx' # Get this from your profile
$octopusURI = 'http://localhost' # Your Octopus Server address
$tentacleThumbprint = "551290... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Machines/RegisterPollingTentacle.ps1 | RegisterPollingTentacle.ps1 | # You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'
$apikey = 'API-xxx' # Get this from your profile
$octopusURI = 'http://localhost' # Your Octopus Server address
$tentacleThumbprint = "3BE9C2... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Machines/AddRoleToAllMachines.ps1 | AddRoleToAllMachines.ps1 | # You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'
$apikey = 'API-RASSW3YNB6FJL3FNWBSSUUCX0C' # Get this from your profile
$octopusURI = 'http://localhost:8065' # Your server address
$role = "... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Users/APIKey_Create.ps1 | APIKey_Create.ps1 | ##CONFIGURATION##
$OctopusURI = "" #Octopus URL
$OctopusUsername = "" #API Key will belong to this user
$OctopusPassword = "" #Password of the user above
$APIKeyPurpose = "" #Brief text to describe the purpose of your API Key.
##PROCESS##
#Adding libraries. Make sure to modify these paths acording t... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Tenants/CreateTenant.ps1 | CreateTenant.ps1 |
# NOTE: this script will fail if the Tenants feature is not enabled on your Octopus Server
# You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'
$apikey = 'API-xxx' # Get this from your profile
... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/StepTemplates/UpdateInDeploymentProcesses.ps1 | UpdateInDeploymentProcesses.ps1 | <#
.Synopsis
Updates the Step Templates used on Deployment Processes to the latest versions
.DESCRIPTION
Step templates can be updated from the library on Octopus, but that doesnt mean that the Deployment processes using that template will start using the latest version right away. Normally, the user would ha... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Variables/AddLibraryVariableSetToAllProjects.ps1 | AddLibraryVariableSetToAllProjects.ps1 | # You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'
$apikey = 'API-ABC123' # Get this from your profile
$octopusURI = 'http://octopus-uri' # Your server address
$endpoint = New-Object Octopus.C... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Variables/UpdateVariableInProject.ps1 | UpdateVariableInProject.ps1 | <#
Add-Type -Path "C:\Program Files\Octopus Deploy\Tentacle\Newtonsoft.Json.dll"
Add-Type -Path "C:\Program Files\Octopus Deploy\Tentacle\Octopus.Client.dll"
#>
$VarName = "" #Name of the variable to modify
$newvalue = "" # New value to set to the variable
$projectName = "" #name of the project where you want... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/Octopus.Client/PowerShell/Variables/AddVariableToLibraryVariableSet.ps1 | AddVariableToLibraryVariableSet.ps1 | # You can this dll from your Octopus Server/Tentacle installation directory or from
# https://www.nuget.org/packages/Octopus.Client/
Add-Type -Path 'Octopus.Client.dll'
$apikey = 'API-MCPLE1AQM2VKTRFDLIBMORQHBXA' # Get this from your profile
$octopusURI = 'http://localhost' # Your server address
$libraryVaria... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/OctopusServerNodes/DeleteAllNodes.ps1 | DeleteAllNodes.ps1 | $octopusURI = "http://localhost:8065" # Replace this with your octopus URL
$apiKey = "API-1232" # Replace this with your API key http://docs.octopusdeploy.com/display/OD/How+to+create+an+API+key
$header = @{ "X-Octopus-ApiKey" = $apiKey }
$nodes = Invoke-WebRequest -Uri "$octopusURI/api/octopusservernodes" -Hea... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Deployments/CreateReleaseAndDeployment.ps1 | CreateReleaseAndDeployment.ps1 | ##CONFIG##
$apiKey = "" #Octopus API Key
$OctopusURL = "" #Octopus URL
$ProjectName = "" #project name
$EnvironmentName = "" #environment name
##PROCESS##
$Header = @{ "X-Octopus-ApiKey" = $apiKey }
#Getting Environment and Project By Name
$Project = Invoke-WebRequest -Uri "$OctopusURL/api/projects... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Deployments/deletedeployment.ps1 | deletedeployment.ps1 | $octopusAPIKey = ""
$octopusURL = ""
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey }
#To get the deployment ID, click on the deployment and you'll reach a URL similar to this: http://localhost/app#/projects/Projects-2/releases/1.0.142/deployments/Deployments-744
#The deployment ID in that case is Deployments-7... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Deployments/DeployExistingReleaseToSpecificSingleMachine.ps1 | DeployExistingReleaseToSpecificSingleMachine.ps1 | ##CONFIG##
$apiKey = "" #Octopus API Key
$OctopusURL = "" #Octopus URL
$ProjectName = "" #project name
$EnvironmentName = "" #environment name
$MachineName = "" #Machine name in Octopus. Accepts only 1 Machine.
$ReleaseVersion = "" #Version of the release you want to deploy. Put 'Latest' if you want to d... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Deployments/CreateDeploymentWithPromptVariables.ps1 | CreateDeploymentWithPromptVariables.ps1 | ##CONFIG##
$apiKey = "Your API Key"
$OctopusURL = "Your Octopus URL"
$ProjectName = "Your Project Name"
$EnvironmentName = "Your Environment Name"
##PROCESS##
$Header = @{ "X-Octopus-ApiKey" = $apiKey }
#Getting Environment and Project By Name
$Project = Invoke-WebRequest -Uri "$OctopusURL/api/projects/$... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Deployments/CancelDeployment.ps1 | CancelDeployment.ps1 | ##CONFIG##
$OctopusURL = "" #Octopus URL
$OctopusAPIKey = "" #Octopus API Key
$ProjectName = "" #Name of the project that owns the deployment
$EnvironmentName = "" #Name of the environment where the deployment is taking place
##PROCESS##
$header = @{ "X-Octopus-ApiKey" = $OctopusAPIKey }
#Get dashboa... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Deployments/CreateReleaseAndDeploymentSkippingSteps.ps1 | CreateReleaseAndDeploymentSkippingSteps.ps1 | ##CONFIG##
$apiKey = "" #Octopus API Key
$OctopusURL = "" #Octopus URL
$ProjectName = "" #project name
$EnvironmentName = "" #environment name
##PROCESS##
$Header = @{ "X-Octopus-ApiKey" = $apiKey }
#Getting Environment and Project By Name
$Project = Invoke-WebRequest -Uri "$OctopusURL/api/projects... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Targets/Targets_Delete.ps1 | Targets_Delete.ps1 | # Data
$OctopusURL = "" #Octopus Root URL
$OctopusAPIKey = "" #Your Octopus API Key
$MachineID = "" #The ID of the machine you want to delete. e.g "Machines-1"
# Delete function
Function Delete-OctopusTarget([string]$ID) {
return Invoke-RestMethod -Uri "$OctopusUrl/api/machines/$ID`?apiKey=$OctopusApiKey" -M... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Targets/RegisterTentacle.ps1 | RegisterTentacle.ps1 | #Config
$OctopusAPIkey = "" #API Key to authenticate in Octopus
$OctopusURL = "" #Octopus server url
$TentacleURL = "" #Tentacle URL. Remember it must be https. i.e "https://localhost","http://192.168.1.12","Http://MyMachineFQDN"
$TentaclePort = "" #Port the Listening Tentacle will use to comunicate with the Octo... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Targets/RegisterSSHEndpoint.ps1 | RegisterSSHEndpoint.ps1 | $headers = @{"X-Octopus-ApiKey"="API-xxxxxxxxxxxxxxxxxxxxxxxxx"}
$environments = Invoke-RestMethod "http://octopus.url/api/environments/all" -Headers $headers -Method Get
$theEnvironment = $environments | ? { $_.Name -eq "TheEnvironmentName" }
$accounts = Invoke-RestMethod "http://octopus.url/api/accounts/all" ... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Targets/EnableOrDisableAMachine.ps1 | EnableOrDisableAMachine.ps1 | ###CONFIG###
$OctopusURL = "http://NY-Octopus1" #Octopus Server root URL
$APIKey = "API-ZC3CBI9HG0XBD3CYYBTWM9UWB8" #Octopus API Key
$machineName = "South" #Name of the machine to enable/disable
###PROCESS###
$header = @{ "X-Octopus-ApiKey" = $APIKey }
#Getting all machines
$allmachines = (Invoke-WebReques... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Targets/CheckHealthOfSpecificTargets.ps1 | CheckHealthOfSpecificTargets.ps1 | Add-Type -Path "" # Path to Newtonsoft.Json.dll
Add-Type -Path "" # Path to Octopus.Client.dll
$OctopusURL = ""
$OctopusAPIKey = ""
$MachineName = "" #Machine Display Name
$endpoint = new-object Octopus.Client.OctopusServerEndpoint $OctopusURL,$OctopusAPIKey
$repository = new-object Octopus.Client.Octop... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Targets/DiscoverTentacle.ps1 | DiscoverTentacle.ps1 | #Config
$OctopusAPIkey = "" #API Key to authenticate in Octopus
$OctopusURL = "" #Octopus server url
$TentacleURL = "" #Tentacle URL that you'll normally use on the Web UI for the discovery
$TentaclePort = "" #Tentacle Port
##Process
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey }
$DiscoverData = Invoke... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Targets/AddRoleToTarget.ps1 | AddRoleToTarget.ps1 | # set up variables
$apikey = ""
$octopusURL = ""
$filter = "My Deployment Target"
# apply a new role to an existing machine
$machines = Invoke-RestMethod -uri ($octopusURL, "/api/machines/all?apikey=", $apikey -join "")
$machine = $machines | ? { $_.Name -eq $filter}
$machine.roles += ("mynewrole")
$putTo ... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Targets/ListMachinesWithUpgradeStatus.ps1 | ListMachinesWithUpgradeStatus.ps1 | ##CONFIG##
$OctopusAPIkey = "" #Octopus API Key
$OctopusURL = "" #Octopus URL
##PROCESS##
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey }
$allMachines = (Invoke-WebRequest $OctopusURL/api/machines/all -Method Get -Headers $header -UseBasicParsing).content | ConvertFrom-Json
$healthyMachines = $allMachines ... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Targets/GetMachinesInCurrentEnvironmentOfSpecificRole.ps1 | GetMachinesInCurrentEnvironmentOfSpecificRole.ps1 | ##CONFIG##
$APIKey = "" #Octopus API. You might wanna create a service account that can only read (all) environments, then create an API key for it and use that Key.
$Role = "" #Role you are looking for
##PROCESS##
$OctopusURL = $OctopusParameters['Octopus.Web.BaseUrl']
$EnvironmentID = $OctopusParameters['Octop... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Targets/GetMachineEnvironments.ps1 | GetMachineEnvironments.ps1 | ###CONFIG###
$APIKey = "API-ZC3CBI9HG0XBD3CYYBTWM9UWB8" #API Key to auth agains the Octopus API
$OctopusURL = "http://NY-Octopus1"#Base URL of your Octopus instance.
###PROCESS##
$header = @{ "X-Octopus-ApiKey" = $APIKey }
$MachineID = $OctopusParameters['Octopus.Machine.ID']
$EnvironmentNames = @()
$AllEnvi... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Targets/UpgradeCalamari.ps1 | UpgradeCalamari.ps1 | Add-Type -Path "" # Path to Newtonsoft.Json.dll
Add-Type -Path "" # Path to Octopus.Client.dll
$OctopusURL = "" #Octopus URL
$OctopusAPIKey = "" # Octopus API Key
$MachineName = "" #Machine Display Name
$endpoint = new-object Octopus.Client.OctopusServerEndpoint $OctopusURL,$OctopusAPIKey
$repository = n... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Targets/CheckHealthOfAllEnvironments.ps1 | CheckHealthOfAllEnvironments.ps1 |
$OctopusURI = ""
$OctopusAPIKey = ""
Add-Type -Path "" # Path to Newtonsoft.Json.dll
Add-Type -Path "" # Path to Octopus.Client.dll
$endpoint = new-object Octopus.Client.OctopusServerEndpoint $OctopusURI, $OctopusAPIKey
$repository = new-object Octopus.Client.OctopusRepository $endpoint
$environments = $rep... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Releases/Release_UpdateVariables.ps1 | Release_UpdateVariables.ps1 | ##CONFIG
$OctopusURL = "" #Octopus URL
$OctopusAPIKey = "" #Octopus API Key
$releaseId = "" #Release Id
##PROCESS##
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey }
Invoke-WebRequest $OctopusURL/api/releases/$releaseId/snapshot-variables -Method Post -Headers $header
|
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Releases/Release_UpdateReleaseNotes.ps1 | Release_UpdateReleaseNotes.ps1 | #This script will update the release notes of the current release
$OctopusURL = "" #URL of Octopus Server
$OctopusAPIKey = "" #API Key to authenticate to Octopus Server
$newreleasenotes = "" #New release note for the current Release
$header = @{ "X-Octopus-ApiKey" = $OctopusAPIKey }
$releaseurl = $OctopusParam... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Releases/CreateRelease.ps1 | CreateRelease.ps1 | # This script will create a new release for a project
$OctopusURL = "" # URL of Octopus Server
$OctopusAPIKey = "" # API Key to authenticate to Octopus Server
$header = @{ "X-Octopus-ApiKey" = $OctopusAPIKey }
# customise the fields below as required:
$body = @{
ProjectId = "Projects-1"
ChannelId = "Ch... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Releases/GetLastSuccessfulForProjectAndEnvironment.ps1 | GetLastSuccessfulForProjectAndEnvironment.ps1 | ##CONFIG
$OctopusURL = "" #Octopus URL
$OctopusAPIKey = "" #Octopus API Key
##PROCESS##
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey }
$ProjectID = $OctopusParameters['Octopus.Project.ID']
$EnvironmentID = $OctopusParameters['Octopus.Environment.ID']
$ProjectDashboardReleases = (Invoke-WebRequest $Octopu... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Lifecycles/SetRetentionPolicyOfAllLifecycles.ps1 | SetRetentionPolicyOfAllLifecycles.ps1 | #This script was tested on Octopus 2.6.5 and 3.7.11 (Should work on all versions between those 2 and beyond)
##CONFIG##
$OctopusAPIkey = ""#Your Octopus API Key
$OctopusURL = ""# Your Octopus instance URL
##PROCESS##
#Getting all lifecycles
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey }
$AllLifecycle... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Lifecycles/CreateLifecycle.ps1 | CreateLifecycle.ps1 | #Connection Info
$OctopusAPIKey = "" #Your API KEy
$OctopusURL = "" #Your Octopus Server URL
$header = @{ "X-Octopus-ApiKey" = $OctopusAPIKey }
$body = @'
{
"Name": "MyNewLifecycle",
"ReleaseRetentionPolicy": {
"ShouldKeepForever": true,
"QuantityToKeep": 0,
"Unit": "Items"... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Events/GetAuditLogForEntity.ps1 | GetAuditLogForEntity.ps1 | $EntityId = "" #the id of the object you want to get the events for. Usually can be obtained from the address bar in the browser
$OctopusURL = "" #url of your octopus server
$OctopusAPIkey = "" #API Key to authenticate in Octopus.
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey }
$json = (Invoke-WebRequest $Oct... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/DeploymentProcesses/RemoveARCSettingsFromProject.ps1 | RemoveARCSettingsFromProject.ps1 | #Script written to fix http://help.octopusdeploy.com/discussions/problems/48848
##CONFIG##
$OctopusAPIkey = "" #Octopus API Key
$OctopusURL = "" #Octopus root url
$ProjectName = "" #Name of the project
##PROCESS##
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey }
$allprojects = (Invoke-WebRequest $Octop... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Projects/DeleteProjectByName.ps1 | DeleteProjectByName.ps1 | ##CONFIG##
$OctopusAPIkey = "" #Octopus API Key
$OctopusURL = "" #Octopus URL
$ProjectName = "" #Project to delete
##PROCESS##
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey }
$allprojects = (Invoke-WebRequest $OctopusURL/api/projects/all -Method Get -Headers $header).content | ConvertFrom-Json
$ProjectT... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Projects/DeleteProjectsWithoutDeploymentProcess.ps1 | DeleteProjectsWithoutDeploymentProcess.ps1 | [CmdletBinding()]
Param(
[Parameter(Mandatory=$true,Position=1)]
[string]$OctopusUrl = "http://localhost:80",
[Parameter(Mandatory=$true,Position=2)]
[string]$ApiKey,
[Parameter(Mandatory=$false,Position=3)]
[switch]$Delete
)
Write-Host "Querying against $OctopusUrl with... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Projects/ChangeProjectLogo.ps1 | ChangeProjectLogo.ps1 | function Invoke-OctopusLogoUpload
{
[CmdletBinding()]
PARAM
(
[string][parameter(Mandatory = $true)][ValidateNotNullOrEmpty()]$InFile,
[string]$ContentType,
[Uri][parameter(Mandatory = $true)][ValidateNotNullOrEmpty()]$Uri,
[string][parameter(Mandatory = $true)]$ApiKe... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Feeds/DeleteFeed.ps1 | DeleteFeed.ps1 | $OctopusAPIkey = "" #Your Octopus API Key
$OctopusURL = "" #Your Octopus base url
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey }
$feedID = "" #ID of the feed you want to delete. The best way to get this ID is by going to Library -> External feeds -> [Edit] on the feed you want to delete -> Check the ID
In... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Feeds/GetAllFeeds.ps1 | GetAllFeeds.ps1 | $OctopusAPIkey = "" #Your Octopus API Key
$OctopusURL = "" #Your Octopus base url
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey }
(Invoke-WebRequest "$OctopusURL/api/feeds" -Headers $header -Method Get).content | ConvertFrom-Json | select -ExpandProperty items |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Feeds/CreateFeed.ps1 | CreateFeed.ps1 | $OctopusAPIkey = $env:OctopusAPIKey
$OctopusURL = $env:OctopusURL
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey }
$body = @{
FeedURI = "http://Packages.com/nuget"
Name = "MyFeed"
Password = @{NewValue = "MyPasswordInClearText"} #remove if feed doesn't have username/password
Username = "Myuse... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Feeds/ModifyFeed.ps1 | ModifyFeed.ps1 | $OctopusAPIkey = "" #Your Octopus API Key
$OctopusURL = "" #Your Octopus base url
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey }
$feedID = "" #ID of the feed you want to modify. The best way to get this ID is by going to Library -> External feeds -> [Edit] on the feed you want to delete -> Check the ID
$bod... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/ManualInterventions/ApproveOrAbort.ps1 | ApproveOrAbort.ps1 | $OctopusURL = "" #Octopus server URL
$OctopusAPIKey = "" #Octopus API Key
$InterruptionID = "" # i.e "Interruptions-204". You can get this ID from the deployment document like this -> /api/interruptions?regarding=[Deployment ID]
$header = @{ "X-Octopus-ApiKey" = $OctopusAPIKey }
$body = @{Instructions= ""
... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Teams/AddEnvironmentsWithPrefixNameToTeam.ps1 | AddEnvironmentsWithPrefixNameToTeam.ps1 | <#
The goal of this script is to find all the environments which name starts with a certain prefix
and add them to a team's scope
The script wont add environments to the team in a smart way. It'll just clear the current list
of environments and add the ones it could find at runtime with the prefix on their name.
... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Teams/AddExternalRoleToTeam.ps1 | AddExternalRoleToTeam.ps1 | # This script will add the specified external role to a team
# External roles are used by authentication providers which support groups
# to automatically place users into a group when they are created
$OctopusURL = "" # URL of Octopus Server
$OctopusAPIKey = "" # API Key to authenticate to Octopus Server
$TeamN... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/License/GetLicenseDetails.ps1 | GetLicenseDetails.ps1 | ##CONFIG##
$OctopusURL = ""
$Octopusapikey = ""
$LicenseLevel = "" #Accepted values are "Team","Professional","Enterprise"
##PROCESS##
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey }
$Projects = ((Invoke-WebRequest $OctopusURL/api/projects/all -Headers $header).content | ConvertFrom-Json).count
$User... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Packages/PushPackage.ps1 | PushPackage.ps1 | # 1. Your Octopus URL
$octopusUrl = "http://localhost";
# 2. An API key, preferably for a Service Account (http://docs.octopusdeploy.com/display/OD/Service+Accounts)
$apiKey = "API-XXXXXXXXXXXXXXXXXXXXXX"
# 3. Path to the package file to upload
$packageFilePath = "C:\Temp\HelloWorldWebApp.2.1.0.0.nupkg";
# ... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Accounts/CreateAzureServicePrincipal.ps1 | CreateAzureServicePrincipal.ps1 | ##CONFIG
$OctopusURL = "" #Octopus URL
$OctopusAPIKey = "" #Octopus API Key
$AccountName = "" #Name you want to give to the account.
$ClientId = "" #Your Azure Active Directory Client ID. This is a GUID in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. This value is known as Client ID in the Azure Portal, and A... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Users/GetUsersAPIKeyList.ps1 | GetUsersAPIKeyList.ps1 | ##Disclaimer: This script only lists the Purpuse, created date & ID of all the currently valid/registered API Keys of each user. It does not show the actual API Key value which cannot be recovered in any way after it was created.
##CONFIG##
$OctopusAPIkey = ""#Your Octopus API Key
$OctopusURL = ""#Your Octopus ser... |
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Miscellaneous/GetOctopusServerVersion.ps1 | GetOctopusServerVersion.ps1 | ##CONFIG##
$OctopusAPIkey = "" #Your Octopus API Key
$OctopusURL = "" #Your Octopus Server root URL
##PROCESS##
$header = @{ "X-Octopus-ApiKey" = $octopusAPIKey }
$ServerVersion = ((Invoke-WebRequest $OctopusURL/api -Method GET -Headers $header).content | ConvertFrom-Json).version
$ServerVersion
|
PowerShellCorpus/Github/OctopusDeploy_OctopusDeploy-Api/REST/PowerShell/Miscellaneous/GetMachinesByRolesInCurrentDeployment.ps1 | GetMachinesByRolesInCurrentDeployment.ps1 | <#
This script should run from:
- A script step
- That's executed on the Octopus Server
- With a Window size of 1
It'll create an output variable called "MachineNames" Which will have the names of the machines (in octopus, so not the same as $env:computername).
To learn more about the usage of output variab... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.