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
# Enter the cmdlet you want to see parameter variables for: | |
$cmdlet = 'Get-Process' | |
$out = @{} | |
foreach ( $param in (get-command $cmdlet).Parameters.Keys ){ | |
$aliases = '' | |
foreach ( $a in $cmd.Parameters.$param.Aliases ){ | |
$aliases += "$a " | |
} |
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
class Xpression | |
{ | |
[string]$Name | |
[scriptblock]$Expression | |
[hashtable] getExpression() { | |
return @{ Name = $this.Name; Expression = $this.Expression } | |
} | |
} | |
class XpressionArray |
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
# Variables for server, database and query | |
$server = 'localhost\sqlexpress' | |
$database = 'test' | |
$query = 'select top 10 * from fjutt' | |
# Set up the objects needed | |
$connection = New-Object -TypeName System.Data.SqlClient.SqlConnection | |
$adapter = New-Object -TypeName System.Data.SqlClient.SqlDataAdapter $command | |
$dataset = New-Object -TypeName System.Data.DataSet |
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
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js'></script> | |
<div id="placeholder"></div> | |
<script> | |
var username = 'johnbravo' | |
$.getJSON('https://api.github.com/users/' + username + '/gists', function (data) { | |
for (var i in data) { | |
var oldDocumentWrite = document.write |
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 AD groups do I manage? | |
get-adgroup -LD "(ManagedBy=$((Get-ADUser -id $env:username).distinguishedname))" | select name | |
### Edit the ISE profile | |
if (Test-Path -Path $profile){ | |
psedit $profile | |
}else{ | |
New-Item -Path $profile -ItemType file -Force -Value | |
psedit $profile | |
} |
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
#Am I the only one using CIM? | |
gcim Win32_OperatingSystem -cn Win81|ft PSC*,*aj*,V*,@{n='BIOSSerial';e={(gcim win32_Bios -cn $_.csname).SerialNumber}} |
NewerOlder