- Install Chocolatey
choco install boxstarter -y
- open "Boxstarter Shell"
- create "Portable Boxstarter" see wiki
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-EvilCmdLet { | |
[CmdletBinding()] | |
param( | |
[ValidateSet('A', 'B')] | |
$Category | |
) | |
Write-Output "= Get-EvilCmdLet =" | |
Write-Output "* PSBoundParameters" | |
$PSBoundParameters.Keys | % { |
troubleshooting chocolatey/boxstarter#405
function choco {
<#
.SYNOPSIS
Intercepts Chocolatey call to check for reboots
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$script:_https_certs = @{} | |
function Add-HTTPSCertificateCheck { | |
param( | |
[string]$Url, | |
[TimeSpan]$ValidityTime | |
) |
NOTE: This seems to only affect Win10 1809 LTSC and/or PowerShell 5.1.17763.1
I've got this demo-script, which I put into a Jenkins job:
Write-Host "##############################################"
$ErrorActionPreference = "Stop"
Write-Host "ErrorActionPreference: $ErrorActionPreference"
Write-Host "whoami: $(whoami)"
$PSVersionTable | Format-Table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Invoke-WithMockedEnv { | |
param( | |
[Parameter(ValueFromPipeline)] | |
[scriptblock]$ScriptBlock, | |
[Hashtable]$mockValues | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
Install all updates available via SCCM and WAIT for the installation to finish. | |
.PARAMETER Computer | |
the computer to install updates on | |
.OUTPUTS | |
a object containing information about the installed updates and the reboot state (if a reboot is required or not) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# IMPORTANT: Before releasing this package, copy/paste the next 2 lines into PowerShell to remove all comments from this file: | |
# $f='c:\path\to\thisFile.ps1' | |
# gc $f | ? {$_ -notmatch "^\s*#"} | % {$_ -replace '(^.*?)\s*?[^``]#.*','$1'} | Out-File $f+".~" -en utf8; mv -fo $f+".~" $f | |
# 1. See the _TODO.md that is generated top level and read through that | |
# 2. Follow the documentation below to learn how to create a package for the package type you are creating. | |
# 3. In Chocolatey scripts, ALWAYS use absolute paths - $toolsDir gets you to the package's tools directory. | |
$ErrorActionPreference = 'Stop'; # stop on all errors | |
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)" | |
# Internal packages (organizations) or software that has redistribution rights (community repo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[Parameter(Mandatory = $False)] | |
[int]$NumberOfProcesses = 1, | |
[Parameter(Mandatory = $False)] | |
[switch]$IncludeMicrosoftProcesses, | |
[Parameter(Mandatory = $False)] | |
[switch]$RequirePath, |