$parms = @{
Path = "C:\windows\system32"
Recurse = $true
ErrorAction = "SilentlyContinue"
}
Measure-Benchmark -RepeatCount 25 -Technique @{
ForEachObject = {
Get-ChildItem @parms | ForEach-Object -Process {
View looping.md
View sys-summit-demo.ps1
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
break | |
<# | |
01. Find instances | |
02. Connect to instances | |
03. Check backups | |
04. Check disk space | |
05. Perform backups | |
06. Check for corruption | |
07. Install maintenance scripts | |
08. Export all settings for DR |
View Test-FileHash.ps1
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 Test-FileHash { | |
<# | |
.Synopsis | |
This is a simple file hash comparison tool that writes to Windows Events when changes are detected | |
.Description | |
This is a simple file hash comparison tool that writes to Windows Events when changes are detected | |
.PARAMETER FilePath | |
The path to the file to hash and compare |
View hugo.yml
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
name: github pages | |
on: | |
push: | |
branches: | |
- blog # Set a branch to deploy | |
pull_request: | |
jobs: | |
deploy: |
View Convert-Pfx.ps1
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 Convert-Pfx { | |
<# | |
.SYNOPSIS | |
Converts PFX to .cer and .key | |
.DESCRIPTION | |
Converts PFX to .cer and .key | |
Requires openssl | |
View ZInstall-KBUpdate.ps1
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
# THIS HASN'T BEEN ADDED TO THE KBUPDATE REPO YET BUT WILL BE WHEN I GET A MOMENT | |
function Install-KbPatch { | |
<# | |
.SYNOPSIS | |
Installs KBs on local and remote servers on Windows-based systems | |
.DESCRIPTION | |
Installs KBs on local and remote servers on Windows-based systems | |
PowerShell 5.1 must be installed and enabled on the target machine and the target machine must be Windows-based |
View getguid.ps1
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
# Install WIX toolset | |
Import-Module "C:\Program Files (x86)\WiX Toolset v3.11\bin\Microsoft.Deployment.Compression.dll" | |
Import-Module "C:\Program Files (x86)\WiX Toolset v3.11\bin\\Microsoft.Deployment.Compression.Cab.dll" | |
$cab = New-Object Microsoft.Deployment.Compression.Cab.Cabinfo "$home\Downloads\file\dotnet-sdk-5.0.404-win-x64_a943fac999a30b3eb83580112b793d37de0c0700.exe" | |
$cab.UnpackFile("0","C:\temp\0.xml") | |
$a = [xml](Get-Content "C:\temp\0.xml") | |
$guid = [guid]$a.BurnManifest.Registration.Id |
View sqldemo.yml
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
name: Test sqlcmd against SQL Server container | |
on: [push, pull_request] | |
jobs: | |
run-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Download and start the container (aka.ms/sqlcontainers) |
View starship.toml
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
add_newline = false | |
format = "$cmd_duration $directory[❯](fg:#ffffff) " | |
[cmd_duration] | |
min_time = 0 | |
format = "\\[[$duration](bold yellow)\\]" | |
[git_status] | |
disabled = true |
View gist:b84c650eeb88dddb924254c7e173e443
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
$base64 = [convert]::ToBase64String(([IO.File]::ReadAllBytes("C:\temp\cert.pfx"))) | |
$buffer = [System.Convert]::FromBase64String($base64, $securestring) | |
$certificate = [System.Security.Cryptography.X509Certificates.X509Certificate2]::new($buffer) | |
Set-AuthenticodeSignature -FilePath $filePath1 -Certificate $certificate |
NewerOlder