Skip to content

Instantly share code, notes, and snippets.

@jhandel
jhandel / Invoke-ScriptBlockAsUser.ps1
Created Jul 5, 2016
Run a script block as creds passed in.
View Invoke-ScriptBlockAsUser.ps1
function Invoke-ScriptBlockAsUser{
param( [ScriptBlock] $scriptBlock,
[string]$adminUserName,
[string]$adminPassword,
$ArgumentList
)
$logonUserSignature =
@'
[DllImport("advapi32.dll", SetLastError = true)]
@jhandel
jhandel / knockout.d.ts
Created Oct 4, 2012
Knockout JS Decleration file for Typescript (just a starter mind ya)
View knockout.d.ts
//Interface started from http://stackoverflow.com/questions/12689716/typescript-with-knockoutjs
interface ObservableNumber {
(newValue: number): ObservableNumber; // Set the value of the observable
(): number; // Get the value of the observable
subscribe: (newValue: number) => void; // Subscribe to get informed when the observable changes
valueHasMutated(): void;
valueWillMutate(): void;
}