PowerShell modules, digital signatures, NuGet nuspec and packages
d-fens GmbH General-Guisan-Strasse 6 CH-6300 Zug Switzerland
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory)] | |
[string]$VMName, | |
[Parameter(Mandatory)] | |
[string]$OutputFile | |
) | |
function Get-DriveType($drive) |
launch powershell with admin privileges | |
run: | |
Install-Package -name git -provider chocolatey | |
Install-Package -name chefdk -minimumVersion 0.6.0.1 -provider chocolatey | |
Install-Package -name atom -provider chocolatey | |
Open powershell window as user | |
apm install linter |
try | |
{ | |
$path = '%system.teamcity.build.checkoutDir%' | |
Set-Location $path | |
$psd1 = Join-Path $path Pester.psd1 | |
Import-Module $psd1 -ErrorAction Stop | |
$xml = Join-Path $path Test.Version.xml |
# | |
# Assumptions | |
# | |
# 1. If you have a Octopus release deployed, say 1.0.0.73, there is a git | |
# tag set for that commit in GitHub that is "v1.0.0.73". | |
# | |
# 2. You have TeamCity label each successful build in GitHub with the format | |
# "v{build number}. Sidenote: it appears that TeamCity only labels the | |
# default branch, but not feature branches. | |
# |
function Is-Default-Branch { | |
return "%teamcity.build.branch.is_default%" -eq "true" | |
} | |
function Build-Arguments { | |
if (Is-Default-Branch) { | |
$releaseNumber = "%octopus.master.releaseNumber%" | |
$deployTo = "%octopus.master.deployTo%" | |
$packageVersion = "%octopus.master.packageVersion%" | |
} |
try { | |
If (-not (choco list -l | Select-String -SimpleMatch 'octopustools' -Quiet)) { | |
throw 'No Chocolatey magig found. EXIT!' | |
} | |
$OctoPath = Join-Path $env:ChocolateyInstall bin | |
$OctoExe = Join-Path $OctoPath 'octo.exe' | |
$Args = '--help','pack','--id=','--include=','--basePath=','--outFolder=','--version=','--author=','--title=','--description=' |
$IP = '192.168.138.10' | |
$MaskBits = 24 # This means subnet mask = 255.255.255.0 | |
$Gateway = '192.168.138.2' | |
$Dns = '192.168.138.2' | |
$IPType = 'IPv4' | |
# Retrieve the network adapter that you want to configure | |
$adapter = Get-NetAdapter | Where-Object {$_.Status -eq 'up'} | |
# Remove any existing IP, gateway from our ipv4 adapter |
function Set-WindowStyle { | |
param( | |
[Parameter()] | |
[ValidateSet('FORCEMINIMIZE', 'HIDE', 'MAXIMIZE', 'MINIMIZE', 'RESTORE', | |
'SHOW', 'SHOWDEFAULT', 'SHOWMAXIMIZED', 'SHOWMINIMIZED', | |
'SHOWMINNOACTIVE', 'SHOWNA', 'SHOWNOACTIVATE', 'SHOWNORMAL')] | |
$Style = 'SHOW', | |
[Parameter()] | |
$MainWindowHandle = (Get-Process –id $pid).MainWindowHandle |
$ServerThreadCode = { | |
$listener = New-Object System.Net.HttpListener | |
$listener.Prefixes.Add('http://+:8008/') | |
$listener.Start() | |
while ($listener.IsListening) { | |
$context = $listener.GetContext() # blocks until request is received | |
$request = $context.Request |