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
{ | |
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": { | |
"osType": { | |
"type": "string", | |
"allowedValues": [ | |
"linux", | |
"windows" | |
], |
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
echo $1 | |
cat /etc/os-release | grep -i pretty |
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
param ( | |
[string] $Name = 'GitHub' | |
) | |
'Hello World from {0}!' -f $Name |
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
$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' |
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
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 { |
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
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 |
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
# 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 |
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
// 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": { |
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-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" | |
) |
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
#region localizeddata | |
if (Test-Path "${PSScriptRoot}\${PSUICulture}") | |
{ | |
Import-LocalizedData ` | |
-BindingVariable LocalizedData ` | |
-Filename MSFT_LMHost.psd1 ` | |
-BaseDirectory "${PSScriptRoot}\${PSUICulture}" | |
} | |
else | |
{ |