Skip to content

Instantly share code, notes, and snippets.

View bgelens's full-sized avatar

Ben Gelens bgelens

View GitHub Profile
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"osType": {
"type": "string",
"allowedValues": [
"linux",
"windows"
],
@bgelens
bgelens / test.sh
Last active March 20, 2018 14:06
test.sh
echo $1
cat /etc/os-release | grep -i pretty
param (
[string] $Name = 'GitHub'
)
'Hello World from {0}!' -f $Name
$armProfileModule = (Get-Module -Name AzureRM.profile -ListAvailable)[0]
Add-Type -Path "$($armProfileModule.ModuleBase)\Newtonsoft.Json.dll"
function Expand-AzureRMTemplate {
<#
.Synopsis
Validates ARM template in combination with parameter file and returns ARM expanded results.
.Example
Expand-AzureRMTemplate -TemplateFile c:\subnet.json -ParameterFile c:\param.json -ResourceGroupName 'myRG'
Set-PowerLinePrompt `
-SetCurrentDirectory `
-RestoreVirtualTerminal `
-PowerLineFont `
-FullColor `
-Title {
$title = "PowerShell {0} - {1} ({2}) - PID: {3}" -f $PSVersionTable.PSVersion.ToString(),(Convert-Path $pwd), $pwd.Provider.Name,$PID
if (Test-Elevation) {
"Elevated - $title"
} else {
wget -Uri https://raw.githubusercontent.com/PowerShell/DscResources/master/Tests.Template/integration_template.ps1 -OutFile .\NetworkingDsc\Tests\Integration\MSFT_LMHost.Integration.Tests.ps1
wget -Uri https://raw.githubusercontent.com/PowerShell/DscResources/master/Tests.Template/integration_config_template.ps1 -OutFile .\NetworkingDsc\Tests\Integration\MSFT_LMHost.Config.ps1
# first test
Describe 'MSFT_LMHost\Test-TargetResource' {
Context 'Invoking with LMHost currently enabled' {
Mock -CommandName 'Test-LMHostEnabled' -MockWith {return $true}
It 'Should return "true" when Enable is set to "true" and current state is "true"' {
Test-TargetResource -IsSingleInstance 'Yes' -Enable $true | Should Be $true
}
It 'Should return "false" when Enable is set to "false" and current state is "true"' {
Test-TargetResource -IsSingleInstance 'Yes' -Enable $false | Should Be $false
// Place your settings in this file to overwrite the default settings
{
"terminal.integrated.shell.windows": "C:\\WINDOWS\\sysnative\\WindowsPowerShell\\v1.0\\powershell.exe",
"editor.renderWhitespace": "boundary",
"workbench.activityBar.visible": true,
"window.zoomLevel": 3,
"terminal.integrated.fontFamily": "monofur for Powerline",
"editor.tabSize": 4,
"editor.detectIndentation": false,
"files.associations": {
New-xDscResource -ModuleName NetworkingDsc -Name MSFT_LMHost -FriendlyName LMHost -ClassVersion 1.0.0.0 -Path ..\Demo -Property @(
New-xDscResourceProperty -Name IsSingleInstance -Attribute Key -Type String -ValidateSet 'Yes' -Description "This is a system wide setting and can only be applied once"
New-xDscResourceProperty -Name Enable -Type Boolean -Attribute Required -Description "This will Enable or Disable LMHost lookup"
)
#region localizeddata
if (Test-Path "${PSScriptRoot}\${PSUICulture}")
{
Import-LocalizedData `
-BindingVariable LocalizedData `
-Filename MSFT_LMHost.psd1 `
-BaseDirectory "${PSScriptRoot}\${PSUICulture}"
}
else
{