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
| #requires -version 7 | |
| using namespace Microsoft.PowerShell.Commands | |
| using namespace System.Text | |
| $ErrorActionPreference = 'Stop' | |
| #Suppress useless IRM Verbose output | |
| $PSDefaultParameterValues['Invoke-RestMethod:Verbose'] = $false | |
| $PSDefaultParameterValues['Invoke-WebRequest:Verbose'] = $false | |
| $DebugPreference = 'SilentlyContinue' |
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
| $global:originalPSConsoleHostReadLine = $function:global:PSConsoleHostReadLine | |
| $global:originalPrompt = $function:global:Prompt | |
| $function:global:PSConsoleHostReadLine = { | |
| $startProgressIndicator = "`e]9;4;3;50`e\" | |
| $command = $originalPSConsoleHostReadLine.Invoke() | |
| $startProgressIndicator | Write-Host -NoNewLine | |
| $command | |
| } |
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
| # Copyright: (c) 2022, Jordan Borean (@jborean93) <[email protected]> | |
| # MIT License (see LICENSE or https://opensource.org/licenses/MIT) | |
| Function Get-LogonSessionData { | |
| <# | |
| .SYNOPSIS | |
| Get LSA logon session data. | |
| .DESCRIPTION | |
| Get the logon session information for all or a specific logon session or specific process logon sessions. |
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
| [Flags()] enum CertCheckMode { | |
| VerifyClientCertRevocation = 0x00000000 | |
| VerifyRevocationUsingCacheOnly = 0x00000002 | |
| DefaultRevocationFreshnessTimeIsEnabled = 0x00000004 | |
| NoUsageCheck = 0x00010000 | |
| } | |
| [Flags()] enum SslFlags { | |
| None = 0x00000000 | |
| UseDsMapper = 0x00000001 |
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-ProcessElevated | |
| { | |
| [CmdletBinding()] | |
| [OutputType([bool])] | |
| param ( | |
| [Parameter(Mandatory = $true, ValueFromPipeline = $true)] | |
| [System.Diagnostics.Process] $Process | |
| ) | |
| begin { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 IPSubnet { | |
| [ipaddress]$InitialAddress | |
| [ValidateRange(0,128)] | |
| [int]$SubnetLength | |
| # basic constructor | |
| IPSubnet([ipaddress]$InitialAddress,[int]$SubnetLength){ | |
| $this.InitialAddress = $InitialAddress | |
| $this.SubnetLength = $SubnetLength |
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
| #requires -module Posh-SSH | |
| param ( | |
| [Parameter(Mandatory,ValueFromPipeline,ValueFromPipelineByPropertyName)][String]$Computername, | |
| [ValidateSet("Cisco","JunOS")] | |
| [Parameter(ValueFromPipelineByPropertyName)][String]$DeviceType = "Cisco", | |
| [String]$RepositoryPath = $home\desktop, | |
| [PSCredential]$Credential | |
| ) |
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
| <# | |
| Correct the default UEFI partition layout created by ConfigMgr to save some disk space. | |
| https://docs.microsoft.com/de-de/windows-hardware/manufacture/desktop/configure-uefigpt-based-hard-drive-partitions | |
| ## Notes: | |
| * The recovery partition size for Windows 10 1703 needs to be at least 900 MB or the partition will ignored. | |
| * Windows 10 1511 Winre.wim size: 313.009.179 Bytes | |
| * Windows 10 1607 Winre.wim size: 324.995.101 Bytes |
NewerOlder