PowerShell modules, digital signatures, NuGet nuspec and packages
d-fens GmbH General-Guisan-Strasse 6 CH-6300 Zug Switzerland
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%" | |
} |
# | |
# 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. | |
# |
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 |
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 |
[CmdletBinding()] | |
param( | |
[Parameter(Mandatory)] | |
[string]$VMName, | |
[Parameter(Mandatory)] | |
[string]$OutputFile | |
) | |
function Get-DriveType($drive) |
<powershell> | |
write-output "Running User Data Script" | |
write-host "(host) Running User Data Script" | |
cmd.exe /c net user /add vagrant FooBar@123 | |
cmd.exe /c net localgroup administrators vagrant /add | |
Set-ExecutionPolicy -ExecutionPolicy bypass -Force | |
# RDP |
#Requires -RunAsAdministrator | |
#Requires -Version 3.0 | |
#References: | |
#Getting Started with Nano Server <https://technet.microsoft.com/en-us/library/mt126167.aspx> | |
#Quick Guide - Deploying Nano Server using PowerShell <http://deploymentresearch.com/Research/Post/479/Quick-Guide-Deploying-Nano-Server-using-PowerShell> | |
param ( | |
#[ValidateScript({ Test-Path $_ })] | |
$ConvertWindowsImageScriptPath = 'D:\work\NanoServerSetup\Convert-WindowsImage.ps1' |
secedit /export /cfg c:\secpol.cfg | |
(gc C:\secpol.cfg).replace("PasswordComplexity = 1", "PasswordComplexity = 0") | Out-File C:\secpol.cfg | |
secedit /configure /db c:\windows\security\local.sdb /cfg c:\secpol.cfg /areas SECURITYPOLICY | |
rm -force c:\secpol.cfg -confirm:$false | |
$admin=[adsi]"WinNT://./Administrator,user" | |
$admin.psbase.rename("vagrant") | |
$admin.SetPassword("vagrant") | |
$admin.UserFlags.value = $admin.UserFlags.value -bor 0x10000 | |
$admin.CommitChanges() |
<# | |
.SYNOPSIS | |
Cmdlet help is awesome. Autogenerate via template so I never forget. | |
.DESCRIPTION | |
.PARAMETER | |
.PARAMETER | |
.INPUTS | |
.OUTPUTS |