David Wilson - @daviwil Software Engineer, PowerShell Team
- Visual Studio Code overview
- Configuring the editor
- Extensions
| <# | |
| .Synopsis | |
| Registers a HTTP prefix and listens for a HttpRequest | |
| .DESCRIPTION | |
| Simple PowerShell HTTP Server implementation to respond to a single HTTP request | |
| .EXAMPLE | |
| Get-HttpRequest -UriPrefix "http://+:80/TestUri/" -ResponseData (Get-Content C:\inetpub\wwwroot\index.html) | |
| .EXAMPLE | |
| Get-HttpRequest -UriPrefix "http://127.0.0.1/" -ResponseData "It Works...!" -ShowRequest | |
| #> |
| ' http://zachbonham.blogspot.com | |
| ' | |
| ' use at your own risk. :) | |
| ' | |
| ' assuming that your default scripting engine is CScript.exe | |
| ' cscript //H:CScript | |
| ' | |
| ' | |
| ' Assuming administrator priviledges | |
| ' |
| import random | |
| class Markov(object): | |
| def __init__(self, open_file): | |
| self.cache = {} | |
| self.open_file = open_file | |
| self.words = self.file_to_words() | |
| self.word_size = len(self.words) | |
| self.database() |
David Wilson - @daviwil Software Engineer, PowerShell Team
| #region Module Builder | |
| $Domain = [AppDomain]::CurrentDomain | |
| $DynAssembly = New-Object System.Reflection.AssemblyName(([guid]::NewGuid().ToString())) | |
| $AssemblyBuilder = $Domain.DefineDynamicAssembly($DynAssembly, [System.Reflection.Emit.AssemblyBuilderAccess]::Run) # Only run in memory | |
| $ModuleBuilder = $AssemblyBuilder.DefineDynamicModule(([guid]::NewGuid().ToString()), $False) | |
| #endregion Module Builder | |
| #region STRUCTs | |
| #Order of creating these Structs is important | |
| #region MyStruct | |
| $Attributes = 'AutoLayout, AnsiClass, Class, Public, SequentialLayout, Sealed, BeforeFieldInit' |
In order of first appearance in The Morning Paper.
A checklist for designing and developing internet scale services, inspired by James Hamilton's 2007 paper "On Desgining and Deploying Internet-Scale Services."
| # 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' |
| $xlFixedFormat = [Microsoft.Office.Interop.Excel.XlFileFormat]::xlOpenXMLWorkbook | |
| write-host $xlFixedFormat | |
| $excel = New-Object -ComObject excel.application | |
| $excel.visible = $true | |
| $folderpath = "C:\Users\gabceb\Documents\testXLS" | |
| $filetype ="*xls" | |
| Get-ChildItem -Path $folderpath -Include $filetype -recurse | | |
| ForEach-Object ` | |
| { | |
| $path = ($_.fullname).substring(0, ($_.FullName).lastindexOf(".")) |