This file contains hidden or 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 Export-SourceModulesToSession | |
{ | |
Param( | |
[Management.Automation.Runspaces.PSSession] | |
[ValidateNotNull()] | |
$Session, | |
[IO.FileInfo[]] | |
[ValidateNotNull()] | |
[ValidateScript( |
This file contains hidden or 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
param([string] $destination = "$(Get-Location)") | |
$client = New-Object System.Net.WebClient | |
$results = [xml]$client.DownloadString('http://packages.nuget.org/v1/FeedService.svc/Packages()?$filter=Id eq ''NuGet.CommandLine''&$orderby=Published desc&$top=1') | |
$path = "${Env:Temp}\nuget.zip" | |
$client.DownloadFile($location.feed.entry.content.src, $path) | |
$shellApplication = New-Object -com Shell.Application | |
$zipItems = $shellApplication.NameSpace($path).Items() | |
$extracted = "${Env:temp}\nuget" | |
if (!(test-path $extracted)) { [Void](New-Item $extracted -type directory) } |
This file contains hidden or 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
<# | |
.NOTES | |
AUTHOR: Keith Hill, [email protected] | |
DATE: Jan 25, 2009 | |
NAME: Tail-Content.ps1 | |
LICENSE: BSD, http://en.wikipedia.org/wiki/BSD_license | |
Copyright (c) 2009, Keith Hill | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without |
%2520-%2520Default%2520Colors.jpg)
%2520New.jpg)
This file contains hidden or 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
$chromeExtensions = @' | |
{ | |
"extensions": { | |
"settings": { | |
"fdmmgilgnpjigdojojpjoooidkmcomcm": { | |
"active_permissions": { | |
"api": [ "cookies" ], | |
"explicit_host": [ "http://*/*", "https://*/*" ], | |
"scriptable_host": [ "http://getpostman.com/*", "https://getpostman.com/*" ] | |
}, |
This file contains hidden or 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 Update-SessionEnvironment { | |
$user = 'HKCU:\Environment' | |
$machine ='HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager\Environment' | |
#ordering is important here, $user comes after so we can override $machine | |
$machine, $user | | |
Get-Item | | |
% { | |
$regPath = $_.PSPath | |
$_ | |
This file contains hidden or 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
$vmParams = @{ | |
NameSpace = 'Root\Virtualization'; | |
Query = 'SELECT * FROM Msvm_KvpExchangeComponent' #pulls VM WMI object ExchangeComponents | |
} | |
Get-WmiObject @vmParams | | |
% { | |
$xml = [Xml]"<properties>$($_.GuestIntrinsicExchangeItems)</properties>" | |
$xml.properties.INSTANCE.Property | | |
% { |
This file contains hidden or 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
Param( | |
[Parameter(Mandatory=$true, ValueFromPipeline=$true)] | |
[string] | |
$Process, | |
[Parameter(Mandatory=$true)] | |
#[string] | |
[ValidatePattern("^(\d\.){0,1}(([0|1]\d)|(2[0-3])):[0-5]\d:[0-5]\d")] | |
$TimeSpan, |
This file contains hidden or 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
# Note that this only works for user keys that are *loaded* and that you have access to | |
New-PSDrive HKU Registry HKEY_USERS | |
Get-ChildItem HKU: -ErrorAction SilentlyContinue | | |
% { Write-Host "`n`nEnvironment variables for $_"; Get-ItemProperty "HKU:\$_\Environment" -ErrorAction SilentlyContinue } |