This file contains 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 2 | |
<# | |
.SYNOPSIS | |
<Overview of script> | |
.DESCRIPTION | |
<Brief description of script> | |
.PARAMETER <Parameter_Name> | |
<Brief description of parameter input required. Repeat this attribute if required> |
This file contains 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
/server add <name> <team>.irc.slack.com/6667 -ssl -password=<password> | |
/set irc.server.<name>.ssl_verify off | |
/set irc.server.<name>.nicks <username> | |
/connect <name> |
This file contains 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
"SET PATH=C:\irssi\bin;%PATH%" & SET PERL5LIB=lib/perl5/5.8 & SET TERMINFO_DIRS=terminfo & irssi.exe -cur_console:d:"C:\irssi" |
This file contains 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
## Please set the ROOT to the folder your nxlog was installed into, | |
## otherwise it will not start. | |
#define ROOT C:\Program Files\nxlog | |
define ROOT C:\Program Files (x86)\nxlog | |
define CERTDIR %ROOT%\cert | |
Moduledir %ROOT%\modules | |
CacheDir %ROOT%\data | |
Pidfile %ROOT%\data\nxlog.pid |
This file contains 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
# Add a domain user to a remote server local group, if your current user has admin over the remote machine | |
powershell -c ([ADSI]'WinNT://SERVER/Administrators,group').add('WinNT://DOMAIN/USER,user') | |
# Get all local groups on a remote server | |
powershell -c "([ADSI]'WinNT://SERVER,computer').psbase.children | where { $_.psbase.schemaClassName -eq 'group' } | foreach { ($_.name)[0]}" | |
# Find members of the local Administrators group on a remote server | |
powershell -c "$([ADSI]'WinNT://SERVER/Administrators,group').psbase.Invoke('Members') | foreach { $_.GetType().InvokeMember('ADspath', 'GetProperty', $null, $_, $null).Replace('WinNT://', '') }" | |
# Enable the local Administrator account on a remote server |
This file contains 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
# Other hosts (ISE, ConEmu) don't always work as well with PSReadLine. | |
# Also, if PS is run with -Command, PSRL loading is suppressed. | |
$psrlMod = Get-Module PSReadLine | |
if (($null -eq $psrlMod) -or ($host.Name -eq 'Windows PowerShell ISE Host')) { | |
return | |
} | |
elseif ($psrlMod.Version.Major -lt 2) { | |
throw "PSReadLine 1.x installed or not imported, import PSRL or ugprade to at least 2.x." | |
} |
This file contains 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
# Load | |
Split-Path $MyInvocation.MyCommand.Path -Parent | Push-Location | |
Get-ChildItem poco_*.ps1 | %{. $_} | |
Pop-Location | |
function Select-Poco | |
{ | |
Param | |
( | |
[Object[]]$Property = $null, |
This file contains 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
add-type -TypeDefinition @" | |
using System; | |
public static class KeyboardEventTestUtil { | |
public static string keybd_event(byte bVk, byte bScan, UInt32 dwFlags, System.UIntPtr dwExtraInfo) { | |
return string.Format("{0}:{1}:{2}:{3}", bVk,bScan,dwFlags,dwExtraInfo); | |
} | |
} | |
"@ | |
describe "t" { |
This file contains 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 EnsureServiceStarted { | |
param($Name) | |
Start-Service -name $name | |
$service = Get-Service -Name $name | |
$service.Status -eq [ServiceProcess.ServiceControllerStatus]::Running | |
} | |
Describe "Ensure service is started" { | |
It "Started service returns true" { | |
mock start-service {} |
This file contains 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
// Place your key bindings in this file to overwrite the defaults | |
[ | |
{ "key": "alt+n", "command": "explorer.newFile" }, | |
{ "key": "alt+shift+s", "command": "PowerShell.InvokeRegisteredEditorCommand", | |
"args": { "commandName": "ConvertToSplatExpression" }, | |
"when": "editorLangId == 'powershell'" }, | |
{ "key": "ctrl+shift+q", "command": "workbench.action.toggleMaximizedPanel" }, | |
{ "key": "ctrl+shift+s", "command": "workbench.action.files.saveAll" }, | |
{ "key": "ctrl+shift+t", "command": "workbench.action.tasks.test" }, | |
{ "key": "ctrl+alt+t", "command": "workbench.action.tasks.runTask" }, |
OlderNewer