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
| ipmo wpk | |
| function Get-Color{ | |
| [Windows.Media.Brushes] | | |
| Get-Member -Static -MemberType Property | | |
| ForEach { [Windows.Media.Brushes]::$($_.Name) } | |
| } | |
| function Get-Brightness { | |
| param ( |
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 Invoke-CompileAllTS { | |
| <# | |
| .Synopsis | |
| Recursively searches for TypeScript files and invokes the compiler on the target | |
| .Example | |
| Invoke-CompileAllTS | |
| #> | |
| ls . -Recurse *.ts | ForEach {tsc $_.fullname} | |
| } |
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
| var name = "System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"; | |
| var asmName = new System.Reflection.AssemblyName(name); | |
| var asm = System.Reflection.Assembly.Load(asmName); |
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
| # Which do you think takes less time to multiply the #'s 1 to 55? | |
| function Test-Timings { | |
| param( | |
| $iterations=5, | |
| $type, | |
| $sb | |
| ) | |
| 1..$iterations | ForEach { |
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
| # http://developer.crunchbase.com/page | |
| function Get-Acquisition { | |
| param( | |
| [Parameter(ValueFromPipeLine)] | |
| $company = "facebook" | |
| ) | |
| Process { | |
| $url = "http://api.crunchbase.com/v/1/company/$($company).js" |
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 ($key) | |
| <# | |
| # sample package.ps1 | |
| @{ | |
| start = {1..10} | |
| stuff = "this is stuff" | |
| } | |
| #> |
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 Invoke-NodeJS { | |
| param( | |
| $PowerShellCommand, | |
| [Switch]$ReturnAsJSON | |
| ) | |
| if($ReturnAsJSON) {$PowerShellCommand += " | ConvertTo-Json"} | |
| $tmp = [IO.Path]::GetTempFileName() |
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
| $url="http://www.manning.com/jones2/" | |
| (Invoke-WebRequest $url).links | where onclick -match 'free' | foreach { | |
| [PSCustomObject] @{ | |
| innerHTML = $_.innerHTML | |
| FullHref = $url+$_.href | |
| href = $_.href | |
| url = $url | |
| } | |
| } | ForEach { |
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
| # http://p0w3rsh3ll.wordpress.com/2013/01/11/searching-microsoft-security-bulletins/ | |
| $MSBulletins = New-WebServiceProxy -Uri 'http://technet.microsoft.com/sto/services/BulletinSearch.asmx' | |
| #int productId, | |
| #bool mostRecent, | |
| #string startDate, | |
| #string endDate, | |
| #Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy1o_services_BulletinSearch_asmx.SortField sortField, | |
| #Microsoft.PowerShell.Commands.NewWebserviceProxy.AutogeneratedTypes.WebServiceProxy1o_services_BulletinSearch_asmx.SortOrder sortOrder, |
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
| pushd | |
| md OWIN | out-null | |
| cd OWIN | |
| npm install express | |
| npm install owin | |
| Add-Type -OutputAssembly OwinHelloWorld.dll -TypeDefinition @" |
OlderNewer