Skip to content

Instantly share code, notes, and snippets.

@iainbrighton
iainbrighton / OutHtml.Tests.ps1
Created February 26, 2020 11:42
OutHtml.Tests.ps1
It 'creates paragraph with embedded new line' {
$expected = '<div>Embedded<br />New Line</div>';
$paragraphText = 'Embedded{0}New Line' -f [System.Environment]::NewLine
$result = Paragraph $paragraphText | OutHtmlParagraph;
$result | Should BeExactly $expected;
}
It 'creates a tabular table cell with an embedded new line' {
$licenses = 'Standard{0}Professional{0}Enterprise' -f [System.Environment]::NewLine
@iainbrighton
iainbrighton / XD7StoreFrontStore.schema.psm1
Last active July 29, 2019 13:08
Example XD7StoreFrontStore Composite Resource
configuration XD7StoreFrontStore
{
param (
[Parameter(Mandatory = $true)]
[System.String]
$StoreName,
[Parameter(Mandatory = $true)]
[ValidateSet("Explicit", "Anonymous")]
[System.String]
@iainbrighton
iainbrighton / windows10media.json
Last active March 22, 2023 09:29
Legacy Windows 10 Lability Media
[{
"Id": "WIN10_x64_Enterprise_1809_EN_Eval",
"Filename": "WIN10_x64_ENT_RS5_EN_Eval.iso",
"Description": "Windows 10 64bit Enterprise 1809 English Evaluation",
"Architecture": "x64",
"ImageName": "Windows 10 Enterprise Evaluation",
"MediaType": "ISO",
"OperatingSystem": "Windows",
"Uri": "https://software-download.microsoft.com/download/sg/17763.107.101029-1455.rs5_release_svc_refresh_CLIENTENTERPRISEEVAL_OEMRET_x64FRE_en-us.iso",
"Checksum": "89AB238E51F0AF6E72C8B7115DE03154",
## Prerequisites
## OneDrive configured and synchronised for Documents redirection
Enable-MicrosoftUpdate
Move-LibraryDirectory -libraryName Personal -NewPath ~\OneDrive\Documents
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -DisableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar -EnableOpenFileExplorerToQuickAccess -EnableExpandToOpenFolder
Update-ExecutionPolicy -Policy RemoteSigned
choco install Microsoft-Hyper-V-All --source windowsFeatures -y
@iainbrighton
iainbrighton / Citrix-Receiver-4.11.log
Created March 21, 2018 12:26
Chocolatey install/uninstall log
C:\Windows\system32>choco list --local-only
Chocolatey v0.10.8
chocolatey 0.10.8
1 packages installed.
C:\Windows\system32>choco install "C:\Users\Administrator\Documents\citrix-receiver.4.11.nupkg"
The use of .nupkg or .nuspec in for package name or source is known to cause issues. Please use the package id from the nuspec `<id />` with `-s .` (for local folder where nupkg is found).
Chocolatey v0.10.8
Installing the following packages:
C:\Users\Administrator\Documents\citrix-receiver.4.11.nupkg
@iainbrighton
iainbrighton / Dsc101WorkshopPrep.ps1
Created March 11, 2018 20:16
PowerShell DSC 101 Workshop Prep Script
#requires -RunAsAdministrator
#requires -Version 5
<#
For the PowerShell Desired State Configuration 101 Workshop you will need
the following:
1. A Windows 2016 virtual machine. This can be any hypervisor you have
available e.g. Hyper-V, VMware Workstation or VirtualBox.
@iainbrighton
iainbrighton / Find-CumulativeWindowsUpdate.ps1
Created July 13, 2017 08:40
Finds the latest Windows 10/Server 2016 cumulative update(s)
function Find-CumulativeWindowsUpdate {
<#
.SYNOPSIS
Finds the latest Windows 10/Server 2016 cumulative update(s).
.EXAMPLE
Find-CumulativeWindowsUpdate
KB Description Uri
-- ----------- ---
@iainbrighton
iainbrighton / Format-Pester.ps1
Created June 12, 2017 19:43
Sample colourised Format-Pester output
Function Format-Pester {
<#
.SYNOPSIS
Document Pester's tests results into the selected format (HTML, Word, Text).
.DESCRIPTION
Create documents in formats: HTML, Word, Text using PScribo PowerShell module. Documents are preformated to be human friendly.
Local Word installation is not needed to be installed on the computers were documents.
Additional languages (other than en-US) can be used - please read info for translator on the project web page.
<#
## String comparison that will return the incorrect result
'1.9' -gt '1.10'
True
## Casting to [System.Version] compares successfully
[version]'1.9' -gt [version]'1.10'
False
<#
To download the latest version of a module, use https://www.powershellgallery.com/api/v2/package/<ModuleName>
e.g. https://www.powershellgallery.com/api/v2/package/dbatools
To download a specific module version, use https://www.powershellgallery.com/api/v2/package/<ModuleName>/<ModuleVersion>
e.g. https://www.powershellgallery.com/api/v2/package/dbatools/0.8.948
#>