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 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
| 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
| [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
| 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
| function Test-IPv4Address { | |
| [CmdletBinding()] | |
| param( | |
| [parameter(Mandatory=$true, ValueFromPipeline=$true, HelpMessage='Enter data to validate as IP Address.')] | |
| [alias('IPAddress')] | |
| [string]$IP | |
| ) | |
| begin{} | |
| process{ |
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
| $Computer = 'localhost' | |
| Get-EventLog -ComputerName $Computer System -Source Microsoft-Windows-Winlogon | select $UserProperty,$TypeProperty,$TimeProeprty |
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 Copy-VSCodeUserSnippets { | |
| [CmdletBinding()] | |
| param( | |
| [Parameter(Mandatory=$true, HelpMessage="Enter the destination address")] | |
| [String] $Destination | |
| ) | |
| # Global Variables | |
| $SnippetFolder = "C:\Users\$ENV:Username\AppData\Roaming\Code\User\snippets\" |
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
| // ================================================== | |
| // = FileName: daysTillConverge2020.go | |
| // = Author: Matt Johnson (@mwjcomputing) | |
| // = Description: Calculates days until Converge 2020 | |
| // ================================================== | |
| package main | |
| import ( | |
| "fmt" |
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
| # ================================================== | |
| # = FileName: daysTillConverge2020.py | |
| # = Author: Matt Johnson (@mwjcomputing) | |
| # = Description: Calculates days until Converge 2020 | |
| # ================================================== | |
| # Import datetime module | |
| import datetime | |
| # Set start of Converge 2020 date and time |