Skip to content

Instantly share code, notes, and snippets.

View PrzemyslawKlys's full-sized avatar
🍉
Dreaming about great things! A bit bored...

Przemysław Kłys PrzemyslawKlys

🍉
Dreaming about great things! A bit bored...
View GitHub Profile
@indented-automation
indented-automation / ADDns.ps1
Created July 21, 2022 14:30
This is a mess. Needs major refactoring.
##############################################################################################################################################################
# IANA #
##############################################################################################################################################################
#
# Address family
#
New-Enum -ModuleBuilder $IndentedDnsMB -Name "Indented.Dns.IanaAddressFamily" -Type "UInt16" -Members @{
IPv4 = 1; # IP version 4
@vexx32
vexx32 / PowershellLoopBehavior.md
Last active January 15, 2022 10:36 — forked from JustinGrote/PowershellLoopBehavior.md
Reference Table for Loop Behavior in Powershell
Loop Return Continue Break
Normal Expectation Exit Scope Next Item Exit Loop
.foreach{} Next Item Break Scopes / Next Item of Parent Loop Break Scopes / Exit Parent Loop
foreach ($y in $x) Exit Scope Next Item Exit Loop
for ($i;$i -lt 5;$i++) Exit Scope Next Item Exit Loop
Foreach-Object -InputObject @() Next Item Break Scopes / Next Item of Parent Loop Break Scopes / Exit Parent Loop
Switch Exit Scope Next Item Exit Switch
While
@i128
i128 / TraceDetailedDNSLogs.ps1
Created July 3, 2019 16:50
Simple Script for Parsing Detailed DNS Debug Logs
function Get-DNSDebugLog
{
<#
.SYNOPSIS
This cmdlet parses a Windows DNS Debug log with details.
Author: @jarsnah12
License: BSD 3-Clause
Required Dependencies: None
Optional Dependencies: None
@ChendrayanV
ChendrayanV / home.ps1
Created January 7, 2019 08:19
PSHTML | MetroUI | PowerShell | Polaris
# Import-Module .\assemblies\PSHTML\PSHTML.psd1
html -Content {
head -Content {
Title -Content "iCMS | Home"
Link -href "./../assets/css/metro.min.css" -rel "stylesheet"
Link -href "./../assets/css/metro-colors.min.css" -rel "stylesheet"
Link -href "./../assets/css/metro-rtl.min.css" -rel "stylesheet"
Link -href "./../assets/css/metro-icons.min.css" -rel "stylesheet"
script -src "./../assets/js/jquery-3.3.1.min.js"
script -src "./../assets/js/metro.min.js"
@nohwnd
nohwnd / scopechecks.ps1
Created December 12, 2018 15:54
Shared state between DSL keywords in Pester
# in module scope
$script:pester
function describe () {
$script:pester.EnterBlock("describe")
}
function it () {
using Namespace System.Management.Automation.Language
Function Get-AliasTarget {
[cmdletbinding()]
param (
[Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)]
[Alias('PSPath', 'FullName')]
[string[]]$Path
)
@indented-automation
indented-automation / Save-WebCertificate.ps1
Last active June 23, 2023 16:56
Save-WebCertificate
function Save-WebCertificate {
param (
# Attempt to acquire a certificate from the specified URI
[Parameter(Mandatory)]
[ValidateScript( { $_.Scheme -eq 'https' } )]
[Uri]$Uri,
# Save the certificate in PEM format to the specified path.
[Parameter(Mandatory)]
[String]$Path,
@keithga
keithga / Get-LatestUpdate.ps1
Last active February 23, 2024 13:17
script to get latest build.
<#
.SYNOPSIS
Get the latest Cumulative update for Windows
.DESCRIPTION
This script will return the list of Cumulative updates for Windows 10 and Windows Server 2016 from the Microsoft Update Catalog.
.NOTES
Copyright Keith Garner (KeithGa@DeploymentLive.com), All rights reserved.
@JustinGrote
JustinGrote / Get-WinEventXPathFilter.ps1
Last active October 4, 2023 14:55
Get-WinEventXPathFilter
Function Get-WinEventXPathFilter
{
<#
.SYNOPSIS
This function generates an xpath filter that can be used with the -FilterXPath
parameter of Get-WinEvent. It may also be used inside the <Select></Select tags
of a Custom View in Event Viewer.
.DESCRIPTION
This function generates an xpath filter that can be used with the -FilterXPath
parameter of Get-WinEvent. It may also be used inside the <Select></Select tags