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 Invoke-Template { | |
param( | |
[string]$Path, | |
[Scriptblock]$ScriptBlock | |
) | |
function Get-Template { | |
param($TemplateFileName) | |
$content = [IO.File]::ReadAllText( | |
(Join-Path $Path $TemplateFileName) ) | |
Invoke-Expression "@`"`r`n$content`r`n`"@" |
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
--------------------------------------------------- | |
Control Panel | |
module: CONTROL.EXE | |
command: rundll32.exe shell32.dll,Control_RunDLL | |
result: displays all the Control Panel icons in | |
an Explorer view |
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
//Copy from thottams@microsoft.com 15 Aug 2006 8:29 PM | |
using System; | |
using System.CodeDom; | |
using System.CodeDom.Compiler; | |
using Microsoft.CSharp; | |
using Microsoft.VisualBasic; | |
using System.IO; | |
namespace ConsoleApplication1 | |
{ |
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
tcpdump advanced filters | |
======================== | |
Sebastien Wains <sebastien -the at sign- wains -dot- be> | |
http://www.wains.be | |
$Id: tcpdump_advanced_filters.txt 36 2013-06-16 13:05:04Z sw $ | |
Notes : |
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
#make sure modem stuff | |
#(hardware flow control set up easy seme as cmd console write-line read-line ...) example bluetooth modem | |
#if just serial port(USB-RS232)you may be set rts enable | |
#serial port very slow io you know you need infinite patience | |
$port = new-Object System.IO.Ports.SerialPort COM7,115200,None,8,one | |
$port.RtsEnable =$true | |
start-Sleep -m 1000 | |
$port.Open() | |
# device init need some time | |
#program enter sleep that make sure init task complete |
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
ANSI Escape Sequences | |
Wherever you see '#', that should be replaced by the appropriate number. | |
ESC code sequence Function | |
------------------- --------------------------- | |
Cursor Controls: | |
ESC[#;#H or ESC[#;#f Moves cusor to line #, column # | |
ESC[#A Moves cursor up # lines | |
ESC[#B Moves cursor down # lines |
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
New-Object System.Collections.ObjectModel.Collection["string"] | |
# from msdn | |
#[SerializableAttribute] | |
#[ComVisibleAttribute(false)] | |
#public class Collection<T> : IList<T>, ICollection<T>, IEnumerable<T>, IList, ICollection, IEnumerable | |
# | |
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
#source="http://blogs.technet.com/b/heyscriptingguy/archive/2012/02/19/use-powershell-to-find-last-logon-times-for-virtual-#workstations.aspx?utm_source=twitterfeed&utm_medium=twitter" | |
$Computer = 'NJLT-Service' | |
$Win32OS = Get-WmiObject -Class Win32_OperatingSystem -ComputerName $Computer | |
$Build = $Win32OS.BuildNumber | |
#The “If ($Build -ge 6001)” is the first decision point. | |
#if the build number is 6001 and above, the script block will run. | |
if ($Build -ge 6001) | |
{ | |
$Win32User = Get-WmiObject -Class Win32_UserProfile -ComputerName $Computer |
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
# updated for pseventing 1.1 | |
if ((get-pssnapin pseventing -ea silentlycontinue) -eq $null) { | |
add-pssnapin pseventing | |
} | |
function add-eventhandler ($variable, | |
$eventName , | |
[scriptblock]$script = $(throw "script cannot be 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
from http://msmvps.com/blogs/lduncan/pages/20217.aspx | |
How Do I Rebuilt a Corrupt WMI Repository? | |
The following can be done through a batch file or executed manually from the command line: | |
net stop winmgmt | |
c: | |
cd %systemroot%\system32\wbem | |
rd /S /Q repository | |
NewerOlder