start new:
tmux
start new with session name:
tmux new -s myname
| input { | |
| tcp { | |
| type => "syslog" | |
| host => "127.0.0.1" | |
| port => 3514 | |
| } | |
| tcp { | |
| type => "eventlog" | |
| host => "10.1.1.2" | |
| port => 3515 |
| function Assert-Authentication { | |
| [CmdletBinding()] | |
| param( | |
| [switch]$Force | |
| ) | |
| if(!$script:AuthSession -Or $Force) { | |
| $creds = Get-CLCAPICredentials -ActiveCredential | |
| if(!$Creds){ |
| #Require -Version 5.0 | |
| # using statement must appear before any other statements in a script. | |
| # other using types(Assembly/Command/Module/Type) is not supported yet? | |
| # [Enum]::GetNames('System.Management.Automation.Language.UsingStatementKind') | |
| using namespace System.Diagnostics | |
| using namespace System.Linq | |
| function Main | |
| { |
| function Get-WSManTrust { | |
| (Get-Item -Path WSMan:\localhost\Client\TrustedHosts | % Value).split(',') | |
| } | |
| function New-WSManTrust { | |
| param( | |
| [string]$hostname | |
| ) | |
| Set-Item -Path WSMan:\localhost\Client\TrustedHosts -Value $hostname -Concatenate -Force | |
| } |
| # Define the signature - i.e. __EventFilter | |
| $EventFilterArgs = @{ | |
| EventNamespace = 'root/cimv2' | |
| Name = 'LateralMovementEvent' | |
| Query = 'SELECT * FROM MSFT_WmiProvider_ExecMethodAsyncEvent_Pre WHERE ObjectPath="Win32_Process" AND MethodName="Create"' | |
| QueryLanguage = 'WQL' | |
| } | |
| $InstanceArgs = @{ | |
| Namespace = 'root/subscription' |
| [cmdletbinding()] | |
| Param() | |
| #Adding definitions for accessing the Audio API | |
| Add-Type -TypeDefinition @' | |
| using System.Runtime.InteropServices; | |
| [Guid("5CDF2C82-841E-4546-9722-0CF74078229A"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] | |
| interface IAudioEndpointVolume { | |
| // f(), g(), ... are unused COM method slots. Define these if you care | |
| int f(); int g(); int h(); int i(); |
| # mute here: https://bsky.app/moderation | |
| election | |
| president-elect | |
| hurricane | |
| storm surge | |
| climate crisis | |
| Iran | |
| Israel | |
| ballistic missiles | |
| North Korea |
| # Create single HttpClient | |
| $client = [System.Net.Http.HttpClient]::new() | |
| # Perform multiple GETs | |
| foreach ($url in $urls) { | |
| $clientResult = $client.GetStringAsync($url). | |
| GetAwaiter(). | |
| GetResult() | |
| $clientResult | ConvertFrom-Json | |
| } |