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-ADReplicationSchedule | |
{ | |
[CmdletBinding()] | |
param | |
( | |
[Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] | |
[System.DirectoryServices.ActiveDirectory.ActiveDirectorySchedule]$ReplicationSchedule, | |
[Parameter(ValueFromPipelineByPropertyName = $true, Mandatory = $true)] | |
[string]$DistinguishedName |
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
#URL that needs to be fetched | |
$url = "https://site.state.gov/default.aspx" | |
#get the server name in case the process jumps to another script | |
$serverName = $env:computername | |
#wrapped it into a try/catch for some type of error handling | |
TRY { | |
#use invoke-webrequest to fetch a session from the site | |
Invoke-WebRequest $url -SessionVariable session -UseBasicParsing |
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 System; | |
using System.Diagnostics; | |
using System.Runtime.InteropServices; | |
using System.Text; | |
public class TestClass | |
{ | |
public TestClass() | |
{} |
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
Import-Module AnyBox | |
[string]$default_input = 'localhost' | |
[hashtable]$answer = $null | |
[bool]$continue = $true | |
[hashtable]$common = @{WindowStyle = 'ToolWindow'; Title = 'Process Killer'; CancelButton = 'Cancel'} | |
while ($continue) { |
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
$ModuleScript = { | |
$folders = @('functions', 'private', 'classes') | |
ForEach ($folder in $folders) | |
{ | |
$currentPath = $PSScriptRoot | Join-Path -ChildPath $folder | |
If (Test-Path -Path $currentPath -PathType Container) | |
{ | |
$functions = Get-ChildItem -Path $currentPath -Filter '*.ps1' |
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
Verifying my Blockstack ID is secured with the address 16jwg75QpMSHynxFLb8DNHwSJTJnTvvDJ2 https://explorer.blockstack.org/address/16jwg75QpMSHynxFLb8DNHwSJTJnTvvDJ2 |
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
$cimSessionOption = New-CimSessionOption -Protocol Dcom | |
$cimSession = New-CimSession -ComputerName $env:computername -SessionOption $cimSessionOption | |
Invoke-CimMethod -CimSession $cimSession -ClassName win32_process -methodname Create -Arguments @{ | |
commandline = "powershell.exe -executionpolicy bypass -file \\$env:computername\c`$\ps\test.ps1" | |
} |
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-CertificateChain { | |
param( | |
[string]$server=$(throw "Mandatory parameter -Server is missing."), | |
[int]$port=$(throw "Mandatory parameter -Port is missing."), | |
[switch]$ToBase64 | |
) | |
$code=@" | |
using System; | |
using System.Collections; | |
using System.Net; |
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-ADGroupMemberSamAccountName { | |
param( | |
[Parameter(Mandatory,ValueFromPipeline)] | |
[ValidateNotNullOrEmpty()] | |
[string]$GroupName | |
) | |
process { | |
$name = $GroupName | |
$domain = [System.DirectoryServices.ActiveDirectory.Domain]::GetCurrentDomain() | |
$dc = $domain.FindDomainController([System.DirectoryServices.ActiveDirectory.LocatorOptions]::WriteableRequired) |
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 System; | |
using System.IO; | |
using System.Diagnostics; | |
using System.Windows.Forms; | |
using System.Configuration.Install; | |
using System.Runtime.InteropServices; | |
//KeyStroke Mouse Clicks Code | |
/* | |
* https://code.google.com/p/klog-sharp/ | |
*/ |