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 -RunAsAdministrator | |
<# | |
.Synopsis | |
Creates (or alters) a "code" command for opening Visual Studio Code (or VS Code Insiders) | |
.Description | |
Recreates the "code.cmd"" batch file command that starts Visual Studio Code (or VS Code Insiders) | |
1. Adds logic to make it open in the current folder if you don't pass parameters. | |
2. Makes "code" work as a command in Windows 10 Explorer's address bar. | |
#> | |
[CmdletBinding()] |
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
/* | |
To automate your slack instance invites, | |
1. Create a google form with two text fields: | |
"Your email" | |
"Who invite you" | |
2. You will get a google table with responses and 3 fields: | |
1) "Timestamp" |
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 | |
Collects each SQL Edition Type by Instance Name. | |
.DESCRIPTION | |
Enumerates the registry for installed instances of SQL, then foreach installed instance, it enumerates the Edition Type. | |
.EXAMPLE | |
Get-SqlEdition -ComputerName MySQLServer.mydomain.org | |
.EXAMPLE | |
@("MyComputer","MyServer","MyDomainController") | %{ Get-SqlEdition -ComputerName $_ } | |
.NOTES |
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 adminMode() { | |
Start-Process -FilePath "$PSHOME\powershell.exe" -Verb runas -WorkingDirectory $PWD.Path | |
Exit | |
} | |
Set-Alias -Name "elevated" -Value "adminMode" |
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
# emulate Unix diff command w/ Powershell script | |
# usage: ps_diff.ps1 red_fish.txt blue_fish.txt [logpath] | |
$diff = compare-object (get-content $args[0]) (get-content $args[1]) | |
if ($args[2] -eq $null) {write-output $diff} | |
else {add-content $args[2] $diff} |