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
$VMName = 'My VM' | |
(Get-CimInstance -Namespace Root\Virtualization\V2 -ClassName Msvm_VirtualSystemSettingData -Filter "ElementName = '$VMName'").BiosGUID |
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
Find-Module -Tag DSC |
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
Install-Module -Name cFSRM |
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
Save-Module -Name cFSRM -Path c:\temp |
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 Sample_ciSCSIInitiator | |
{ | |
Param | |
( | |
[String] $NodeName = 'LocalHost' | |
) | |
Import-DscResource -Module ciSCSI | |
Node $NodeName |
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
Describe 'MSFT_xFirewall\Get-TargetResource' { | |
Context 'Absent should return correctly' { | |
Mock Get-NetFirewallRule | |
It "Should return absent on firewall rule $($FirewallRule.Name)" { | |
$result = Get-TargetResource -Name 'FirewallRule' | |
$result.Name | Should Be 'FirewallRule' | |
$result.Ensure | Should Be '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
# Get the rule that will be used for testing | |
$FirewallRuleName = (Get-NetFirewallRule | ` | |
Sort-Object Name | ` | |
Where-Object {$_.DisplayGroup -ne $null} | ` | |
Select-Object -first 1).Name | |
$FirewallRule = Get-FirewallRule -Name $FirewallRuleName | |
$Properties = Get-FirewallRuleProperty -FirewallRule $FirewallRule | |
# Pull two rules to use testing that error is thrown when this occurs | |
$FirewallRules = (Get-NetFirewallRule | ` | |
Sort-Object 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
data LocalizedData | |
{ | |
# culture="en-US" | |
ConvertFrom-StringData -StringData @' | |
GettingiSCSIVirtualDiskMessage=Getting iSCSI Virtual Disk "{0}". | |
iSCSIVirtualDiskExistsMessage=iSCSI Virtual Disk "{0}" exists. | |
iSCSIVirtualDiskDoesNotExistMessage=iSCSI Virtual Disk "{0}" does not exist. | |
SettingiSCSIVirtualDiskMessage=Setting iSCSI Virtual Disk "{0}". | |
EnsureiSCSIVirtualDiskExistsMessage=Ensuring iSCSI Virtual Disk "{0}" exists. | |
EnsureiSCSIVirtualDiskDoesNotExistMessage=Ensuring iSCSI Virtual Disk "{0}" does not exist. |
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
Import-LocalizedData -BindingVariable LocalizedData -Filename BMD_cMyNewResource.psd1 |
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
Write-Verbose -Message ($LocalizedData.iSCSIVirtualDiskExistsMessage -f $Path) |
OlderNewer