Skip to content

Instantly share code, notes, and snippets.

View dotps1's full-sized avatar

Thomas Malkewitz dotps1

View GitHub Profile
@Jaykul
Jaykul / Set-CodeCmd.ps1
Last active March 7, 2018 19:21
This makes it so you can type just `code` to start VS Code (even Insiders) in the current folder, even ... in Explorer!
#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()]
@vors
vors / SlackAutoInvite.js
Last active May 9, 2020 17:51
Automation for sending Invites on Slack. Based on Google Forms and Google script. For more context read https://levels.io/slack-typeform-auto-invite-sign-ups/
/*
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"
@dotps1
dotps1 / Get-SqlEdition.ps1
Last active August 29, 2015 13:56
Gets SQL Edition Type for each installed SQL Instance
<#
.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
@janbaer
janbaer / gist:5276178
Created March 30, 2013 09:59
Restart your current powershell console as Administrator
function adminMode() {
Start-Process -FilePath "$PSHOME\powershell.exe" -Verb runas -WorkingDirectory $PWD.Path
Exit
}
Set-Alias -Name "elevated" -Value "adminMode"
@mshock
mshock / ps_diff.ps1
Created October 8, 2012 20:29
Powershell diff
# 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}