Skip to content

Commit

Permalink
Fix examples for Wiki (#202)
Browse files Browse the repository at this point in the history
  • Loading branch information
johlju committed Jun 12, 2022
1 parent 6d1e087 commit b0397fb
Show file tree
Hide file tree
Showing 31 changed files with 153 additions and 37 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ For older change log history see the [historic changelog](HISTORIC_CHANGELOG.md)
- Updated README.md from _xHyper-V_ to _HyperVDsc
- Renamed default branch to `main` - Fixes [Issue #198](https://github.com/dsccommunity/HyperVDsc/issues/198).
- Moved documentation to the HyperVDsc GitHub Wiki.
- Updated all examples to correct folders and naming so they show up
in the GitHub Wiki documentation and conceptual help.

## [3.18.0] - 2022-06-04

Expand Down
2 changes: 1 addition & 1 deletion source/DSCResources/DSC_VHD/DSC_Vhd.schema.mof
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
class DSC_Vhd : OMI_BaseResource
{
[Key, Description("The desired VHD file name.")] String Name;
[Key, Description("he desired Path where the VHD will be created.")] String Path;
[Key, Description("The desired Path where the VHD will be created.")] String Path;
[Write, Description("Parent VHD file path, for differencing disk.")] String ParentPath;
[Write, Description("Maximum size of VHD to be created.")] Uint64 MaximumSizeBytes;
[Write, Description("Virtual disk format. The default value is `Vhd`."), ValueMap{"Vhd","Vhdx"}, Values{"Vhd","Vhdx"}] String Generation;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
configuration Sample_VMHardDiskDrive_VMWithExtraDisk
<#
.DESCRIPTION
VM with an extra disk.
#>
configuration Example
{
param
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
configuration Sample_VMHardDiskDrive_VMWith4AdditionalDisks
<#
.DESCRIPTION
VM with 4 additional disks.
#>
configuration Example
{
param
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Configuration Sample_VMHost_Paths
<#
.DESCRIPTION
Set paths för the Hyper-V host.
#>
Configuration Example
{
param
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
configuration Sample_VMHyperV_Simple
<#
.DESCRIPTION
Create a new VM.
#>
configuration Example
{
param
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
configuration Sample_VMHyperV_SimpleWithDvdDrive
<#
.DESCRIPTION
Create a VM with DVD drive attached to it.
#>
configuration Example
{
param
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
configuration Sample_VMHyperV_SimpleWithNestedVirtualization
<#
.DESCRIPTION
Create a VM with nested virtualization.
#>
configuration Example
{
param
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
configuration Sample_VMHyperV_Complete
<#
.DESCRIPTION
Complete example.
#>
configuration Example
{
param
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
configuration Sample_VMHyperV_DynamicMemory
<#
.DESCRIPTION
VM using dynamic memory.
#>
configuration Example
{
param
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Configuration Sample_VMHyperV_MultipleNICs
<#
.DESCRIPTION
Description not yet written.
#>
Configuration Example
{
param
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Configuration Sample_VMNetworkAdapter_ManagementOS
<#
.DESCRIPTION
Description not yet written.
#>
Configuration Example
{
Import-DscResource -ModuleName 'HyperVDsc' -Name VMNetworkAdapter
Import-DscResource -ModuleName PSDesiredStateConfiguration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Configuration Sample_VMNetworkAdapter_MultipleManagementOS
<#
.DESCRIPTION
Description not yet written.
#>
Configuration Example
{
Import-DscResource -ModuleName 'HyperVDsc' -Name VMNetworkAdapter
Import-DscResource -ModuleName PSDesiredStateConfiguration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Configuration Sample_VMNetworkAdapter_MultipleVM
<#
.DESCRIPTION
Add three network adapters to the same switch.
#>
Configuration Example
{
Import-DscResource -ModuleName 'HyperVDsc' -Name VMNetworkAdapter
Import-DscResource -ModuleName PSDesiredStateConfiguration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Configuration Sample_VMNetworkAdapter_MultipleVMMACAddress
<#
.DESCRIPTION
Description not yet written.
#>
Configuration Example
{
Import-DscResource -ModuleName 'HyperVDsc' -Name VMNetworkAdapter
Import-DscResource -ModuleName PSDesiredStateConfiguration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Configuration Sample_VMNetworkAdapter_VMStaticNetworkSettings
<#
.DESCRIPTION
Add a network adapter that is using static IP address.
#>
Configuration Example
{
Import-DscResource -ModuleName 'HyperVDsc'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Configuration Sample_VMNetworkAdapter_VMVlanTagging
<#
.DESCRIPTION
Add a network adapter that is using a VLAN tag.
#>
Configuration Example
{
Import-DscResource -ModuleName 'HyperVDsc' -Name VMNetworkAdapter
Import-DscResource -ModuleName PSDesiredStateConfiguration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
configuration Sample_VMScsiController_AddControllers
<#
.DESCRIPTION
Add a SCSI controller to a VM.
#>
configuration Example
{
param
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
configuration Sample_VMSwitch_External
<#
.DESCRIPTION
Creates a switch of the type External.
#>
configuration Example
{
param
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Configuration Sample_VMSwitch_ExternalSET_LBMode
<#
.DESCRIPTION
Creates a switch that is of type External and using load balancing.
#>
Configuration Example
{
param
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Configuration Sample_VMSwitch_ExternalSET
<#
.DESCRIPTION
Creates a switch of the type External and uses embedded teaming.
#>
Configuration Example
{
param
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
configuration Sample_VMSwitch_Internal
<#
.DESCRIPTION
Creates a switch of the type Internal.
#>
configuration Example
{
param
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
configuration Sample_VHD_NewVhd
<#
.DESCRIPTION
Description not yet written.
#>
configuration Example
{
param
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
configuration Sample_Vhd_AdditionalPropertyVHD
<#
.DESCRIPTION
Description not yet written.
#>
configuration Example
{
param
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
configuration Sample_Vhd_DiffVhd
<#
.DESCRIPTION
Description not yet written.
#>
configuration Example
{
param
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
configuration Sample_Vhd_FixedVhd
<#
.DESCRIPTION
Description not yet written.
#>
configuration Example
{
param
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
configuration Sample_VHD_MissingPropertyVHD
<#
.DESCRIPTION
Description not yet written.
#>
configuration Example
{
param
(
Expand All @@ -25,7 +29,7 @@ configuration Sample_VHD_MissingPropertyVHD

Node localhost
{
VHD WrongVHD
Vhd WrongVHD
{
Ensure = $Ensure
Name = $Name
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
Configuration Sample_Vhd_ChangeAttribute
<#
.DESCRIPTION
Not yet written.
#>
Configuration Example
{
param
(
[Parameter(Mandatory = $true, Position = 0)]
[Parameter()]
$vhdPath = 'C:\temp\disk.vhdx',

[Parameter(Mandatory = $true)]
[Parameter()]
$relativeDestinationPath = 'Temp',

[Parameter()]
Expand All @@ -23,6 +27,5 @@ Configuration Sample_Vhd_ChangeAttribute
DestinationPath = $relativeDestinationPath
Attributes = $attribute
}

}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Configuration Sample_Vhd_CopyFileOrFolder
<#
.DESCRIPTION
Not yet written.
#>
Configuration Example
{
param
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
Configuration Sample_Vhd_RemoveFileOrFolderFromVHD
<#
.DESCRIPTION
Not yet written.
#>
Configuration Example
{
param
(
Expand Down
11 changes: 7 additions & 4 deletions source/Examples/Sample_EndToEndHyperV_RunningVM.ps1
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# End to end sample for x-Hyper-v
Configuration Sample_EndToEndHyperV_RunningVM
<#
.DESCRIPTION
End to end sample for running a VM in HyperV
#>
Configuration Example
{
param
(
Expand Down Expand Up @@ -36,7 +39,7 @@ Configuration Sample_EndToEndHyperV_RunningVM

# Customize VHD by copying a folders/files to the VHD before a VM can be created
# Example below shows copying unattended.xml before a VM can be created
VhdFile CopyUnattendxml
VhdFile CopyUnattendedXml
{
VhdPath = $vhdPath
FileDirectory = DSC_FileDirectory
Expand All @@ -47,7 +50,7 @@ Configuration Sample_EndToEndHyperV_RunningVM
}

# create the testVM out of the vhd.
VMHyperV testvm
VMHyperV TestVM
{
Name = "$($name)_vm"
SwitchName = 'Test-Switch'
Expand Down

0 comments on commit b0397fb

Please sign in to comment.