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
Get-CMConfigurationItem | Where-Object { $_.LocalizedDisplayName -like "CI - Deprovisioned AppX -*" -And $_.InUse -eq $true } | Select-Object LocalizedDisplayName,@{Name="AppName";Expression={[Regex]::Matches($_.SDMPackageXML,"\`$_\.DisplayName -Match ('.+')").Groups[1].Value}} |
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 Connect-CMDrive { | |
param( | |
# SMS provider or site server | |
[Parameter(Mandatory=$false, Position = 0)] | |
[ValidateScript({ | |
If(!(Test-Connection -ComputerName $_ -Count 1 -ErrorAction SilentlyContinue)) { | |
throw "Host `"$($_)`" is unreachable" | |
} Else { | |
return $true | |
} |
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 Copy-CMTSDeployments { | |
<# | |
.SYNOPSIS | |
A function to copy deployments from one task sequence to another. Modify the New-CMTaskSequenceDeployment parameters in the splat as desired. | |
.EXAMPLE | |
PS C:\> Copy-CMTSDeployments -taskSequenceId_old "ABC0037A" -taskSequenceId_new "ABC004EA" -ExcludeCollections "ABC0133F", "ABC01340" | |
Gathers all deployments from task sequence ABC0037A and deploys them to ABC004EA, excluding ABC0133F and ABC01340. | |
.NOTES | |
Author: Adam Cook |
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-CM1902LabBuild { | |
if (-not(Get-Package -Name "AutomatedLab" -ProviderName "msi" -MinimumVersion "5.17.0")) { | |
$Path = "{0}\Downloads\AutomatedLab.msi" -f $HOME | |
Invoke-WebRequest -Uri "https://github.com/AutomatedLab/AutomatedLab/releases/latest/download/AutomatedLab.msi" -OutFile $Path -ErrorAction "Stop" | |
Start-Process "msiexec" -ArgumentList @("/i", $Path, "/qb") -Wait -ErrorAction "Stop" | |
} | |
try { | |
$Path = "{0}\Downloads\codaamok-PoSH" -f $HOME | |
git clone https://github.com/codaamok/PoSH.git $Path |
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
$winFiles = Get-ChildItem c:\windows -Recurse -ErrorAction SilentlyContinue | |
$commands = @{ | |
'Where-Object' = { | |
$exeFiles = $winFiles | Where-Object { $_.Extension -eq ".exe" } | |
} | |
'Where-Object (no script block)' = { | |
$exeFiles = $winFiles | Where-Object Extension -eq ".exe" | |
} | |
'.Where' = { |
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
### Keybase proof | |
I hereby claim: | |
* I am codaamok on github. | |
* I am codaamok (https://keybase.io/codaamok) on keybase. | |
* I have a public key ASAJfgIjA29owfyPLxBNLSM9ssUv-voCVrtVruiP46vWhQo | |
To claim this, I am signing this object: |
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 ConvertTo-Ini { | |
param ( | |
[Object[]]$Content, | |
[String]$SectionTitleKeyName | |
) | |
begin { | |
$StringBuilder = [System.Text.StringBuilder]::new() | |
$SectionCounter = 0 | |
} | |
process { |
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 | |
Create a new properties.json file containing the speaker's name, session title, Twitter handle and local path to their Twitter profile picture. This script also downloads said profile picture. The produced properties.json file is intended to be consumed by index.php within this gist. | |
.EXAMPLE | |
PS C:\> .\New-PSSouthamptonVirtualSession.ps1 -SessionTitle "Some session title goes here" -SpeakerName "Adam Cook" -TwitterHandle "codaamok" | |
Downloads the profile picture of Twitter account @codaamok to "C:\xampp\htdocs\PSSouthampton" | |
Creates properties.json file with the below object: |
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
freedom.to;*.localhost;*.127.0.0.1;*.office.com;*.office365.com;*.office.net;*.onedrive.com;*.sharepoint.com;*.optimizely.com;*.microsoftonline.com;*.production.us.trafficmanager.net;*.microsoft.com;*.live.com;*.oneclient.sfx.ms;*.sharepointonline.com;*.spoprod-a.akamaihd.net;*.prod.msocdn.com;*.svc.ms;*.lync.com;*.broadcast.skype.com;*.skypeforbusiness.com;*.sfbassets.com;*.skypemaprdsitus.trafficmanager.net;*.windows.net;*.msecnd.net;*.aspnetcdn.com;*.live.net;*.aka.ms;*.azure.net;*.windows.com;*.windows.net;*.msedge.net;*.mstea.ms;*.skypeassets.com;*.azureedge.net;*.tenor.com;*.microsoftstream.com;*.assets-yammer.com;*.azureedge.net;*.onenote.com;*.onenote.net;*.aspnetcdn.com;*.optimizely.com;*.msappproxy.net;*.msftidentity.com;*.msidentity.com;*.windowsazure.com;*.microsoftazuread-sso.com;*.microsoftonline-p.net;*.msauth.net;*.msauthimages.net;*.msftauth.net;*.msftauthimages.net;*.phonefactor.net;*.visualstudio.com;*.cloudapp.net;*.staffhub.ms;*.gfx.ms;*.appex.bing.com;*.appex-rf.msn.com;*.getmicrosoftkey |
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
#Requires -Module AutomatedLab | |
Param ( | |
[Parameter(Mandatory=$true)] | |
$LabName, | |
[Parameter(Mandatory=$true)] | |
$Domain | |
) | |
New-LabDefinition -Name $LabName -DefaultVirtualizationEngine HyperV |
OlderNewer