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 Add-TypeDefinition | |
{ | |
[CmdletBinding()] | |
param ( | |
[string] $Path, | |
[string[]] $ReferencedAssemblies = @("Microsoft.CSharp"), | |
[string] $OutputAssembly, | |
[switch] $IgnoreWarnings, | |
[switch] $UseTypeAlias | |
) |
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
$ErrorActionPreference = "Stop" | |
Set-StrictMode -Version Latest | |
$Script:PackageManager = $null | |
function Initialize-NuGetPackageManager | |
{ | |
[CmdletBinding()] | |
param ( | |
[hashtable] $Repositories = @{}, |
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 Main | |
{ | |
$ipAddresses = 1..254 | foreach { "192.168.0.$_" } | |
#$ipAddresses | Invoke-ParallelPing | Out-GridView | |
Invoke-ParallelPing -ComputerName $ipAddresses | Out-GridView | |
} | |
function Invoke-ParallelPing | |
{ |
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
#Requires -RunAsAdministrator | |
function Main | |
{ | |
$ErrorActionPreference = "Stop" | |
$VerbosePreference = "Continue" | |
#Target account to assign previlage | |
$svcAccount = "TestSvc" |
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
<# | |
.SYNOPSIS | |
Configure Internet Explorer SecurityZone Settings. | |
.DESCRIPTION | |
Note: Configration is not applied immediately, Need to restart related services to apply zone settings. | |
.LINK | |
http://support.microsoft.com/kb/184456/en-us |
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
#Requires -RunAsAdministrator | |
#Requires -Version 5.0 | |
$ErrorActionPreference = "Stop" | |
function Main | |
{ | |
#Size of dummy file, that transffered by PSRemoting. | |
$fileSize = 10MB |
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
$ErrorActionPreference = "Stop" | |
$notificationTitle = "Notification: " + [DateTime]::Now.ToShortTimeString() | |
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] > $null | |
$template = [Windows.UI.Notifications.ToastNotificationManager]::GetTemplateContent([Windows.UI.Notifications.ToastTemplateType]::ToastText01) | |
#Convert to .NET type for XML manipuration | |
$toastXml = [xml] $template.GetXml() | |
$toastXml.GetElementsByTagName("text").AppendChild($toastXml.CreateTextNode($notificationTitle)) > $null |
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
#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 | |
{ |
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 Test-Message | |
{ | |
Write-Verbose "Test Message" -Verbose | |
} | |
Describe "Test-Remotely"{ | |
It "Send local function to remote session"{ | |
#Arrange: Send local function definition to remote session | |
Remotely ([ScriptBlock]::Create(${Function:Test-Message}.Ast.Extent.Text)) |
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
<Query Kind="Program"> | |
<NuGetReference>Newtonsoft.Json</NuGetReference> | |
<NuGetReference Version="4.5.0-alpha01" Prerelease="true">NLog</NuGetReference> | |
<Namespace>NLog</Namespace> | |
<Namespace>NLog.Config</Namespace> | |
<Namespace>NLog.Targets</Namespace> | |
<Namespace>Newtonsoft.Json</Namespace> | |
</Query> | |
void Main() |