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 |
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 |
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) |
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 |
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 |
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
# /etc/rundeck/profile | |
-Drundeck.jetty.connector.forwarded=true | |
# /etc/rundeck/rundeck-config.properties | |
grails.serverURL=https://rundeck | |
#dataSource.url = jdbc:h2:file:/var/lib/rundeck/data/rundeckdb;MVCC=true | |
dataSource.driverClassName = com.microsoft.sqlserver.jdbc.SQLServerDriver | |
dataSource.url = jdbc:sqlserver://localhost;DatabaseName=rundeck | |
dataSource.username = rundeck | |
dataSource.password = xyz |
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
$MyScript = [powershell]::Create() | |
$null = $MyScript.AddScript( { Import-Module -Name Terminal-Icons } ) | |
$Runspace = [runspacefactory]::CreateRunspace() | |
$MyScript.Runspace = $Runspace | |
$null = Register-ObjectEvent -InputObject $MyScript -EventName InvocationStateChanged -Action { | |
Import-Module -Name Terminal-Icons | |
} |
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 New-Logger { | |
$dll = Join-Path -Path $script:ModuleRoot -ChildPath log4net.dll | |
$null = Add-Type -Path $dll | |
$pattern = '[%date{yyyy-MM-dd HH:mm:ss}] [%level] [%message]%n' | |
$layout = [log4net.Layout.ILayout](New-Object log4net.Layout.PatternLayout($Pattern)) | |
$dir = "C:\temp" # this is actually in my json config file | |
$dir = Join-Path -Path $dir -ChildPath logs | |
if (-not (Test-Path -Path $dir)) { |
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
##### Expand $env:psmodulepath to include C:\github | |
$env:psmodulepath = "$env:psmodulepath;C:\github\twitch\;C:\github\;C:\github\psframework\" | |
#### Tired of typing this out. notepad $hosts instead | |
$hosts = "C:\windows\system32\drivers\etc\hosts" | |
#### Quickly import everything I'm currently working on | |
function f { | |
write-output "force imports all the modules I'm working on (import-module -force), which reloads my changes" | |
Import-Module tvbot, tvclient, tentools -Force |
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 |