Skip to content

Instantly share code, notes, and snippets.

View Dalmirog-zz's full-sized avatar

Dalmiro Granas Dalmirog-zz

View GitHub Profile
$usernameToFind = "DOMAIN\USERNAME"
Add-Type -AssemblyName System.DirectoryServices.AccountManagement
$contextType = [System.DirectoryServices.AccountManagement.ContextType]::Domain
$context = New-Object System.DirectoryServices.AccountManagement.PrincipalContext -argumentlist ($contextType)
$user = [System.DirectoryServices.AccountManagement.UserPrincipal]::FindByIdentity($context, $usernameToFind)
Write-Output $user
[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
@Dalmirog-zz
Dalmirog-zz / octo-artifacts.ps1
Last active December 18, 2019 19:48 — forked from rirl/octo-artifacts.ps1
Download ALL artifacts for a given deployment from Octopus Deploy to the artifacts directory
# Try it in powershell...
[Reflection.Assembly]::LoadFile("C:\Program Files\Octopus Deploy\Tentacle\Newtonsoft.Json.dll")
[Reflection.Assembly]::LoadFile("C:\Program Files\Octopus Deploy\Tentacle\Octopus.Client.dll")
[Reflection.Assembly]::LoadFile("C:\Program Files\Octopus Deploy\Tentacle\Octopus.Platform.dll")
# Basic data
Write-Host "Setup..."
$octoKey=" Your API Key"
$octoUser=" Your user name"
$octoId=" Your deployment id, ie (deployments-1492)"