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
{{<armvisualize href="link-to-json-file">}} | |
{{<armvisualize "link-to-json-file">}} |
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
Add-Type @" | |
using System.Net; | |
using System.Security.Cryptography.X509Certificates; | |
public class TrustAllCertsPolicy : ICertificatePolicy { | |
public bool CheckValidationResult( | |
ServicePoint srvPoint, X509Certificate certificate, | |
WebRequest request, int certificateProblem) { | |
return true; | |
} | |
} |
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()] | |
param | |
( | |
[Parameter(Mandatory = $true)] | |
[String] | |
$ValidationXmlPath | |
) | |
$xml = [xml](Get-Content -Path $ValidationXmlPath) | |
$channels = $xml.Report.Channel.Channel |
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-HttpQueryString | |
{ | |
[CmdletBinding()] | |
param | |
( | |
[Parameter(Mandatory = $true)] | |
[String] | |
$Uri, | |
[Parameter(Mandatory = $true)] |
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
if (-not (Get-Module -ListAvailable -Name ImportExcel -ErrorAction SilentlyContinue)) | |
{ | |
Install-Module -Name ImportExcel -Force | |
} | |
$speakersJson = 'https://raw.githubusercontent.com/psconfeu/2019/master/data/speakers.json' | |
$sessionsJson = 'https://raw.githubusercontent.com/psconfeu/2019/master/sessions.json' | |
$speakers = ConvertFrom-Json (Invoke-WebRequest -UseBasicParsing -Uri $speakersJson).content | |
$sessions = ConvertFrom-Json (Invoke-WebRequest -UseBasicParsing -Uri $sessionsJson).content |
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
#Show the HTML preview | |
$view = New-VSCodeHtmlContentView -Title "TestHTML" -ShowInColumn One | |
Set-VSCodeHtmlContentView -View $view -Content "<h1>Test Output</h1>" | |
Write-VSCodeHtmlContentView $view -Content "Hello, World!<br />" |
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
Configuration GCEDemo | |
{ | |
Import-DscResource -ModuleName PSDesiredStateConfiguration -ModuleVersion 1.1 | |
Node 'localhost' | |
{ | |
WindowsFeature WebServer | |
{ | |
Name = 'Web-Server' | |
Ensure = 'Present' |
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 Write-SerialPort ([string] $message) { | |
$port = new-Object System.IO.Ports.SerialPort COM1,9600,None,8,one | |
$port.open() | |
$port.WriteLine($message) | |
$port.Close() | |
} | |
Write-SerialPort ("Testing GCE Startup Script") | |
Set-NetFirewallRule -Name WINRM-HTTP-In-TCP-PUBLIC -RemoteAddress Any |
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
Start-UdDashboard -Content { | |
New-UdDashboard -Title "Performance Dashboard" -Color '#FF050F7F' -Content { | |
New-UdRow { | |
New-UdColumn -Size 6 -Content { | |
New-UdRow { | |
New-UdColumn -Size 12 -Content { | |
New-UdTable -Title "Server Information" -Headers @(" ", " ") -Endpoint { | |
@{ | |
'Computer Name' = 'NODE01' | |
'Operating System' = (Get-CimInstance -ComputerName NODE01 -ClassName Win32_OperatingSystem).Caption |
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-ConfigurationDataAsObject | |
{ | |
[CmdletBinding()] | |
Param ( | |
[Parameter(Mandatory)] | |
[Microsoft.PowerShell.DesiredStateConfiguration.ArgumentToConfigurationDataTransformation()] | |
[hashtable] $ConfigurationData | |
) | |
return $ConfigurationData | |
} |