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
| 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 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
| 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 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
| $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 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
| param ( | |
| [string] $Name = 'GitHub' | |
| ) | |
| 'Hello World from {0}!' -f $Name |
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
| echo $1 | |
| cat /etc/os-release | grep -i pretty |
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
| { | |
| "$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 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 Get-SoftwareUpdateConfigurations { | |
| [CmdletBinding(DefaultParameterSetName = 'list')] | |
| param ( | |
| [Parameter(Mandatory)] | |
| [ValidateNotNullOrEmpty()] | |
| [string] $ResourceGroupName, | |
| [Parameter(Mandatory)] | |
| [ValidateNotNullOrEmpty()] | |
| [string] $AutomationAccountName, |
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
| $enums = Get-ChildItem -Path $PSScriptRoot\enums\*.ps1 -ErrorAction SilentlyContinue | ForEach-Object -Process { | |
| Get-Content $_.FullName | |
| } | |
| if (Test-Path "$PSScriptRoot\Classes\classes.psd1") { | |
| $ClassLoadOrder = Import-PowerShellDataFile -Path "$PSScriptRoot\classes\classes.psd1" -ErrorAction SilentlyContinue | |
| } | |
| $classes = foreach ($class in $ClassLoadOrder.order) { | |
| $path = '{0}\classes\{1}.ps1' -f $PSScriptRoot, $class |
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
| Mock -CommandName Get-SomeCommand -MockWith { | |
| param ( | |
| $ErrorVariable | |
| ) | |
| $errorRecord = [System.Management.Automation.ErrorRecord]::new( | |
| [System.Exception]::new('Failed!'), | |
| 'Error', | |
| [System.Management.Automation.ErrorCategory]::InvalidOperation, | |
| $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
| { | |
| "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
| "contentVersion": "1.0.0.0", | |
| "parameters": { | |
| "automationAccountName": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The name of the automation account." | |
| } | |
| }, |