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
Function Get-AvailableIPv4Address { | |
param ( | |
[System.Collections.ArrayList] $IPRange | |
) | |
$MaxThreads = 30 | |
$ScriptBlock = { | |
Param ( | |
[String]$IPAddress | |
) |
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": { | |
"storageAccountName": { | |
"type": "string", | |
"defaultValue": "MyARMDemo", | |
"minLength": 3, | |
"maxLength": 24, | |
"metadata": { |
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
$GetTargetResource = @' | |
#TODO - Add the logic for Get-TagetResource | |
#TODO - Always return a hashtable from this function | |
#TODO - Remove $Ensure if it is not required | |
function Get-TargetResource | |
{ | |
[OutputType([Hashtable])] | |
param ( | |
[Parameter()] | |
[ValidateSet('Present','Absent')] |
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 ( | |
[Parameter()] | |
[ValidateSet('VMM','OM','DPM','SCORH','SM','All')] | |
[String] $Component = 'All', | |
[Parameter()] | |
[String] $Destination = $env:TEMP | |
) | |
Begin { |
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
function Get-ConfigurationDataAsObject | |
{ | |
[CmdletBinding()] | |
Param ( | |
[Parameter(Mandatory)] | |
[Microsoft.PowerShell.DesiredStateConfiguration.ArgumentToConfigurationDataTransformation()] | |
[hashtable] $ConfigurationData | |
) | |
return $ConfigurationData | |
} |
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
#Download the module from http://en.community.dell.com/techcenter/systems-management/w/wiki/7727.powershell-cmdlets-for-poweredge-servers | |
Import-Module DellPEPowerShellTools | |
$idracSession = New-PEDRACSession -Credential (Get-Credential) -IPAddress 192.168.100.1 | |
$NicView = Get-CimInstance -ResourceUri 'http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_NICView' -Namespace root\dcim -CimSession $idracSession | |
$NicView | Select DeviceDescription, DeviceNumber, EFIVersion, MediaType |
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
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 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 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 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 />" |