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 Get-DnsLulz { | |
| [CmdletBinding()] | |
| param( | |
| [Parameter(Mandatory=$true)] | |
| [string]$IPAddress | |
| ) | |
| $TheIP = $IPAddress.Split('.') | |
| for ($x=1; $x -le 3; $x++) { |
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
| [Cmdlet(VerbsCommon.Get, "MWJName")] | |
| public class GetMwjName : PSCmdlet | |
| { | |
| private string _typedName; | |
| [Parameter( | |
| Mandatory = true, | |
| ValueFromPipeline = true, | |
| ValueFromPipelineByPropertyName = true, | |
| Position = 0, |
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
| foreach ($entry in $entries) { | |
| $object = New-Object psobject | |
| $object | Add-Member -Name "mail" -value $entry.value | |
| $object | Add-Member -Name "StevesInfo" -Value "Info" | |
| } |
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 New-PoshSecTemplate { | |
| [CmdletBinding()] | |
| param( | |
| ## Baseline Parmerter Set | |
| [Parameter(ParameterSetName='Baseline')] | |
| [switch]$Baseline, | |
| [Parameter(ParameterSetName='Baseline')] | |
| [string]$BaselinePath | |
| ) | |
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
| $wmiQuery = Get-WmiObject -Class Win32_QuickFixEngineering -ComputerName $pcName -Filter "HotFixID=$kbs" | |
| if ($wmiQuery) { | |
| #do stuff | |
| } else { | |
| # do 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 Get-OracleJavaVersion { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(ValueFromPipeline=$true)] | |
| [alias("Computer")] | |
| [string]$ComputerName = "$env:COMPUTERNAME" | |
| ) | |
| begin{ |
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
| Invoke-WebRequest 'http://myip.dnsomatic.com' | Select Content |
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 Get-DaysUntilBSidesDetroit { | |
| Write-Host "There are $((New-Timespan -end '6/7/2013 9:00:00AM').Days) days until BSidesDetroit." | |
| } |
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 Set-LocalPasswords | |
| { | |
| param( | |
| [Parameter(Mandatory=$true, ValueFromPipeline=$true)] | |
| [string]$computer, | |
| [Parameter(Mandatory=$true)] | |
| [string]$password | |
| ) | |
| process { | |
| $userList = Get-WmiObject -Class Win32_UserAccount -ComputerName $computer |
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
| [Net.ServicePointManager]::ServerCertificateValidationCallback = { $true } |