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
| using namespace System.Collections.Generic; using namespace System.Text | |
| Add-Type -TypeDefinition ' | |
| using System; | |
| using System.Runtime.InteropServices; | |
| using System.Text; | |
| public class WindowTools | |
| { | |
| public delegate bool EnumWindowsProc(IntPtr hWnd, int lParam); |
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
| using namespace System.Collections.Generic | |
| using namespace System.Management.Automation | |
| using namespace System.Security.AccessControl | |
| using namespace Microsoft.Win32 | |
| function Get-InstalledSoftware { | |
| [CmdletBinding()] | |
| param( | |
| [Parameter(ValueFromPipeline)] | |
| [ValidateNotNullOrEmpty()] |
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 BigIntRange : System.Collections.IEnumerable | |
| { | |
| [bigint]$from | |
| [bigint]$to | |
| [bool]$Descending | |
| BigIntRange([bigint]$from,[bigint]$to) | |
| { | |
| $this.from = $from |
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 Invoke-NativeCommand { | |
| <# | |
| .SYNOPSIS | |
| Invoke a native command (.exe) as a new process. | |
| .DESCRIPTION | |
| Invoke-NativeCommand executes an arbitrary executable as a new process. Both the standard | |
| and error output streams are redirected. | |
| Error out is written as a single non-terminating error. ErrorAction can be used to raise |
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
| using module ActiveDirectory | |
| using namespace System.Reflection | |
| function Convert-ADFilter { | |
| <# | |
| .SYNOPSIS | |
| Converts PowerShell-style filters used by the AD module into LDAP filters. | |
| .DESCRIPTION | |
| Convert-ADFilter uses the QueryParser from the AD module to convert PowerShell-style filters into LDAP |
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) 2020, Jordan Borean (@jborean93) <jborean93@gmail.com> | |
| # MIT License (see LICENSE or https://opensource.org/licenses/MIT) | |
| Function Invoke-WithImpersonation { | |
| <# | |
| .SYNOPSIS | |
| Invoke a scriptblock as another user. | |
| .DESCRIPTION | |
| Invoke a scriptblock and run it in the context of another user as supplied by -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
| function Test-RpcPort { | |
| <# | |
| .SYNOPSIS | |
| Enumerates and tests connectivity to the RPC ports on the target server. | |
| .DESCRIPTION | |
| Enumerates and tests connectivity to the RPC ports on the target server. | |
| Rebuilt from https://gallery.technet.microsoft.com/Test-RPC-Testing-RPC-4396fcda | |
| #> |
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-XmlFileTreeAppend | |
| { | |
| param( | |
| [Parameter(ParameterSetName='Path', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] | |
| [string[]] | |
| ${Path}, | |
| [Parameter(ParameterSetName='LiteralPath', Mandatory=$true, ValueFromPipelineByPropertyName=$true)] | |
| [Alias('PSPath')] | |
| [string[]] |
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) 2020, Jordan Borean (@jborean93) <jborean93@gmail.com> | |
| # MIT License (see LICENSE or https://opensource.org/licenses/MIT) | |
| Function Get-FtpFile { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Mandatory=$true)] | |
| [System.Uri] | |
| [Alias('Uri')] | |
| $FtpUrl, | |