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
| // Asynchronous Client Socket Example | |
| // http://msdn.microsoft.com/en-us/library/bew39x2a.aspx | |
| using System; | |
| using System.Net; | |
| using System.Net.Sockets; | |
| using System.Threading; | |
| using System.Text; | |
| // State object for receiving data from remote device. |
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
| # Code conversion from C# to PowerShell | |
| # http://msdn.microsoft.com/en-us/library/windows/apps/hh802768.aspx | |
| # nuget Windows 7 API Code Pack -Shell | |
| # http://nugetmusthaves.com/Package/Windows7APICodePack-Shell | |
| # Install-Package Windows7APICodePack-Shell | |
| Add-Type -Path .\Microsoft.WindowsAPICodePack.dll | |
| Add-Type -Path .\Microsoft.WindowsAPICodePack.Shell.dll | |
| # create toast template TO xml |
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
| # getting bound parameters that are NOT common parameters | |
| function Verb-Noun | |
| { | |
| [CmdletBinding()] | |
| Param | |
| ( | |
| [Parameter(Mandatory=$true)] | |
| [string] | |
| $Param1, |
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 Invoke-ElevatedCommand { | |
| <# | |
| .DESCRIPTION | |
| Invokes the provided script block in a new elevated (Administrator) powershell process, | |
| while retaining access to the pipeline (pipe in and out). Please note, "Write-Host" output | |
| will be LOST - only the object pipeline and errors are handled. In general, prefer | |
| "Write-Output" over "Write-Host" unless UI output is the only possible use of the information. | |
| Also see Community Extensions "Invoke-Elevated"/"su" | |
| .EXAMPLE |
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
| <# | |
| Assumes that Fiddler Core Libraries are in same directory as this script. | |
| http://www.telerik.com/fiddler/fiddlercore | |
| This script uses Fiddler Core 4 | |
| #> | |
| function Start-Fiddler { | |
| <# | |
| .Synopsis | |
| Uses FiddlerCore to listen on a specified port. |
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 Send-NetworkData { | |
| [CmdletBinding()] | |
| param ( | |
| [Parameter(Mandatory)] | |
| [string] | |
| $Computer, | |
| [Parameter(Mandatory)] | |
| [ValidateRange(1, 65535)] | |
| [Int16] |
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
| [CmdletBinding()] | |
| [OutputType([System.Management.Automation.PSModuleInfo])] | |
| param( | |
| # The name of the module to install from GitHub. | |
| [Parameter(Position=0, Mandatory=$true)] | |
| [ValidateNotNullOrEmpty()] | |
| [System.String[]] | |
| $ModuleName, | |
| # The scope from which the module should be discoverable. |
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 Import-Portatour { | |
| param ( | |
| [parameter(Mandatory=$True,Position=1)] [ValidateScript({ Test-Path -PathType Leaf $_ })] [String] $FilePath, | |
| [parameter(Mandatory=$False,Position=2)] [System.URI] $ResultURL | |
| ) | |
| # CONST | |
| $CODEPAGE = "iso-8859-1" # alternatives are ASCII, UTF-8 | |
| # We have a REST-Endpoint | |
| $RESTURL = "https://my.portatour.net/a/api/ImportCustomers/" |
NewerOlder