Skip to content

Commit

Permalink
BREAKING CHANGE: xHyper-V renamed to HyperVDsc: Renamed all DSCResour…
Browse files Browse the repository at this point in the history
…ces, Examples, Modules and Tests where applicable (#194)
  • Loading branch information
nickgw committed Jun 8, 2022
1 parent 3f8379f commit 5b69372
Show file tree
Hide file tree
Showing 100 changed files with 372 additions and 368 deletions.
6 changes: 5 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,11 @@
"label": "test",
"type": "shell",
"command": "&${cwd}/build.ps1",
"args": ["-AutoRestore","-Tasks","test"],
"args": [
"-AutoRestore",
"-Tasks",
"test"
],
"presentation": {
"echo": true,
"reveal": "always",
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
For older change log history see the [historic changelog](HISTORIC_CHANGELOG.md).

## [Unreleased]
- xHyper-V
- BREAKING CHANGE
- Renamed _xHyper-V_ to _HyperVDsc - fixes [Issue #69](https://github.com/PowerShell/xHyper-V/issues/213).
- Changed all MSFT_xResourceName to DSC_ResourceName.
- Updated DSCResources, Examples, Modules and Tests for new naming.
- Updated README.md from _xHyper-V_ to _HyperVDsc

## [3.18.0] - 2022-06-04

Expand Down
192 changes: 96 additions & 96 deletions README.md

Large diffs are not rendered by default.

4 changes: 1 addition & 3 deletions RequiredModules.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
MarkdownLinkCheck = 'latest'
'DscResource.Test' = 'latest'
'DscResource.AnalyzerRules' = 'latest'
xDscResourceDesigner = 'latest'
'DscResource.DocGenerator' = 'latest'

# Build dependent modules
'DscResource.Common' = 'latest'
xDscResourceDesigner = 'latest'
}
2 changes: 1 addition & 1 deletion Resolve-Dependency.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ try

$installPowerShellGetParameters = @{
Name = 'PowerShellGet'
Force = $True
Force = $true
SkipPublisherCheck = $true
AllowClobber = $true
Scope = $Scope
Expand Down
3 changes: 1 addition & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -356,8 +356,7 @@ Begin

$BuildConfig = $config[0]
}
else
{
else {
$BuildConfig = $config
}
}
Expand Down
16 changes: 8 additions & 8 deletions build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
####################################################
# ModuleBuilder Configuration #
####################################################

CopyPaths:
- en-US
- DSCResources
Expand All @@ -22,7 +21,7 @@ NestedModule:
Exclude: PSGetModuleInfo.xml

####################################################
# Sampler Pipeline Configuration #
# Pipeline Configuration #
####################################################
BuildWorkflow:
'.':
Expand All @@ -33,7 +32,7 @@ BuildWorkflow:
- Clean
- Build_Module_ModuleBuilder
- Build_NestedModules_ModuleBuilder
- Create_changelog_release_output
- Create_Changelog_Release_Output
- Generate_Conceptual_Help
- Generate_Wiki_Content

Expand All @@ -46,15 +45,15 @@ BuildWorkflow:

test:
- Pester_Tests_Stop_On_Fail
- Pester_if_Code_Coverage_Under_Threshold
- Pester_If_Code_Coverage_Under_Threshold

publish:
- publish_module_to_gallery
- Publish_Release_To_GitHub
- Publish_GitHub_Wiki_Content

####################################################
# PESTER Configuration #
# PESTER Configuration #
####################################################

Pester:
Expand All @@ -64,18 +63,19 @@ Pester:
Script:
- tests/Unit
Tag:
CodeCoverageThreshold: 83
CodeCoverageOutputFile: JaCoCo_coverage.xml
CodeCoverageOutputFileEncoding: ascii
CodeCoverageThreshold: 80

DscTest:
OutputFormat: NUnitXML
ExcludeTag:
- "Common Tests - New Error-Level Script Analyzer Rules"
Tag:
- 'Common Tests - New Error-Level Script Analyzer Rules'
ExcludeSourceFile:
- output
ExcludeModuleFile:
- Modules/DscResource.Common
MainGitBranch: master

ModuleBuildTasks:
Sampler:
Expand Down
5 changes: 3 additions & 2 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
codecov:
require_ci_to_pass: no
# master should be the baseline for reporting
# main should be the baseline for reporting
branch: master

comment:
Expand All @@ -16,13 +16,14 @@ coverage:
project:
default:
# Set the overall project code coverage requirement to 70%
target: 70
target: 80
patch:
default:
# Set the pull request requirement to not regress overall coverage by more than 5%
# and let codecov.io set the goal for the code changed in the patch.
target: auto
threshold: 5

# This is not needed if the module only contain class-based resources.
fixes:
- '^\d+\.\d+\.\d+::source' # move path "X.Y.Z" => "source"
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US'

<#
.SYNOPSIS
Gets MSFT_xVHD resource current state.
Gets DSC_VHD resource current state.
.PARAMETER Name
The desired VHD file name.
Expand Down Expand Up @@ -72,7 +72,7 @@ function Get-TargetResource

<#
.SYNOPSIS
Configures MSFT_xVHD resource state.
Configures DSC_VHD resource state.
.PARAMETER Name
The desired VHD file name.
Expand Down Expand Up @@ -224,7 +224,7 @@ function Set-TargetResource

<#
.SYNOPSIS
Tests if MSFT_xVHD resource state is in the desired state or not.
Tests if DSC_VHD resource state is in the desired state or not.
.PARAMETER Name
The desired VHD file name.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[ClassVersion("1.0.0"), FriendlyName("xVHD")]
class MSFT_xVHD : OMI_BaseResource
[ClassVersion("1.0.0"), FriendlyName("Vhd")]
class DSC_Vhd : OMI_BaseResource
{
[Key, Description("Name of the VHD File")] String Name;
[Key, Description("Folder where the VHD will be created")] String Path;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[ClassVersion("1.0.0.0"), FriendlyName("xVMDvdDrive")]
class MSFT_xVMDvdDrive : OMI_BaseResource
[ClassVersion("1.0.0.0"), FriendlyName("VMDvdDrive")]
class DSC_VMDvdDrive : OMI_BaseResource
{
[Key, Description("Specifies the name of the virtual machine to which the DVD drive is to be added.")] String VMName;
[Key, Description("Specifies the number of the controller to which the DVD drive is to be added.")] Uint32 ControllerNumber;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[ClassVersion("1.0.0"), FriendlyName("xVMHardDiskDrive")]
class MSFT_xVMHardDiskDrive : OMI_BaseResource
[ClassVersion("1.0.0"), FriendlyName("VMHardDiskDrive")]
class DSC_VMHardDiskDrive : OMI_BaseResource
{
[Key, Description("Specifies the name of the virtual machine whose hard disk drive is to be manipulated.")] String VMName;
[Key, Description("Specifies the full path to the location of the VHD that represents the hard disk drive.")] String Path;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US'

<#
.SYNOPSIS
Gets MSFT_xVMHost resource current state.
Gets DSC_VMHost resource current state.
.PARAMETER IsSingleInstance
Specifies the resource is a single instance, the value must be 'Yes'.
Expand Down Expand Up @@ -62,7 +62,7 @@ function Get-TargetResource

<#
.SYNOPSIS
Tests if MSFT_xVMHost resource state is in the desired state or not.
Tests if DSC_VMHost resource state is in the desired state or not.
.PARAMETER IsSingleInstance
Specifies the resource is a single instance, the value must be 'Yes'.
Expand Down Expand Up @@ -241,7 +241,7 @@ function Test-TargetResource

<#
.SYNOPSIS
Configures MSFT_xVMHost resource state.
Configures DSC_VMHost resource state.
.PARAMETER IsSingleInstance
Specifies the resource is a single instance, the value must be 'Yes'.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[ClassVersion("1.0.0.0"), FriendlyName("xVMHost")]
class MSFT_xVMHost : OMI_BaseResource
[ClassVersion("1.0.0.0"), FriendlyName("VMHost")]
class DSC_VMHost : OMI_BaseResource
{
[Key, Description("Specifies the resource is a single instance, the value must be 'Yes'."), ValueMap{"Yes"}, Values{"Yes"}] String IsSingleInstance;
[Write, Description("Indicates whether users can use enhanced mode when they connect to virtual machines on this server by using Virtual Machine Connection.")] Boolean EnableEnhancedSessionMode;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[ClassVersion("1.0.0"), FriendlyName("xVMHyperV")]
class MSFT_xVMHyperV : OMI_BaseResource
[ClassVersion("1.0.0"), FriendlyName("VMHyperV")]
class DSC_VMHyperV : OMI_BaseResource
{
[Key, Description("Name of the VM")] String Name;
[Required, Description("VHD associated with the VM")] String VhdPath;
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ $script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US'

<#
.SYNOPSIS
Gets MSFT_xVMNetworkAdapter resource current state.
Gets DSC_VMNetworkAdapter resource current state.
.PARAMETER Id
Specifies an unique identifier for the network adapter.
Expand Down Expand Up @@ -88,7 +88,7 @@ function Get-TargetResource
$networkInfo = Get-NetworkInformation -VMName $VMName -Name $Name
if ($networkInfo)
{
$item = New-CimInstance -ClassName MSFT_xNetworkSettings -Property $networkInfo -Namespace root/microsoft/windows/desiredstateconfiguration -ClientOnly
$item = New-CimInstance -ClassName MSFT_NetworkSettings -Property $networkInfo -Namespace root/microsoft/windows/desiredstateconfiguration -ClientOnly
$configuration.Add('NetworkSetting', $item)
}

Expand All @@ -112,7 +112,7 @@ function Get-TargetResource

<#
.SYNOPSIS
Sets MSFT_xVMNetworkAdapter resource state.
Sets DSC_VMNetworkAdapter resource state.
.PARAMETER Id
Specifies an unique identifier for the network adapter.
Expand Down Expand Up @@ -344,7 +344,7 @@ function Set-TargetResource

<#
.SYNOPSIS
Tests if MSFT_xVMNetworkAdapter resource state is indeed desired state or not.
Tests if DSC_VMNetworkAdapter resource state is indeed desired state or not.
.PARAMETER Id
Specifies an unique identifier for the network adapter.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@

[ClassVersion("2.0.0.0")]
Class xNetworkSettings
Class NetworkSettings
{
[Write] string IpAddress;
[Write] string Subnet;
[Write] string DefaultGateway;
[Write] string DnsServer;
};

[ClassVersion("2.0.0.0"), FriendlyName("xVMNetworkAdapter")]
class MSFT_xVMNetworkAdapter : OMI_BaseResource
[ClassVersion("2.0.0.0"), FriendlyName("VMNetworkAdapter")]
class DSC_VMNetworkAdapter : OMI_BaseResource
{
[Key] String Id;
[Required] String Name;
[Required] String SwitchName;
[Required] String VMName;
[Write] String MacAddress;
[Write, EmbeddedInstance("xNetworkSettings")] String NetworkSetting;
[Write, EmbeddedInstance("NetworkSettings")] String NetworkSetting;
[Write] String VlanId;
[Write, ValueMap{"Present","Absent"}, Values{"Present","Absent"}] String Ensure;
[Read] Boolean DynamicMacAddress;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US'

<#
.SYNOPSIS
Gets MSFT_xVMProcessor resource current state.
Gets DSC_VMProcessor resource current state.
.PARAMETER VMName
Specifies the name of the virtual machine on which the processor is to be configured.
Expand Down Expand Up @@ -47,7 +47,7 @@ function Get-TargetResource

<#
.SYNOPSIS
Tests if MSFT_xVMProcessor resource state is in the desired state or not.
Tests if DSC_VMProcessor resource state is in the desired state or not.
.PARAMETER VMName
Specifies the name of the virtual machine on which the processor is to be configured.
Expand Down Expand Up @@ -195,7 +195,7 @@ function Test-TargetResource

<#
.SYNOPSIS
Configures MSFT_xVMProcessor resource state.
Configures DSC_VMProcessor resource state.
.PARAMETER VMName
Specifies the name of the virtual machine on which the processor is to be configured.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[ClassVersion("1.0.0.0"), FriendlyName("xVMProcessor")]
class MSFT_xVMProcessor : OMI_BaseResource
[ClassVersion("1.0.0.0"), FriendlyName("VMProcessor")]
class DSC_VMProcessor : OMI_BaseResource
{
[Key, Description("Specifies the name of the virtual machine on which the processor is to be configured.")] String VMName;
[Write, Description("Specifies whether to enable host resource protection.")] Boolean EnableHostResourceProtection;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[ClassVersion("1.0.0"), FriendlyName("xVMScsiController")]
class MSFT_xVMScsiController : OMI_BaseResource
[ClassVersion("1.0.0"), FriendlyName("VMScsiController")]
class DSC_VMScsiController : OMI_BaseResource
{
[Key, Description("Specifies the name of the virtual machine whose SCSI controller status is to be controlled")] String VMName;
[Key, Description("Specifies the number of the SCSI controller whose status is to be controlled. If not specified, it defaults to 0."), ValueMap{"0","1","2","3"}, Values{"0","1","2","3"}] Uint32 ControllerNumber;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ $script:localizedData = Get-LocalizedData -DefaultUICulture 'en-US'

<#
.SYNOPSIS
Gets MSFT_xVMSwitch resource current state.
Gets DSC_VMSwitch resource current state.
.PARAMETER Name
Name of the VM Switch.
Expand Down Expand Up @@ -101,7 +101,7 @@ function Get-TargetResource

<#
.SYNOPSIS
Configures MSFT_xVMSwitch resource state.
Configures DSC_VMSwitch resource state.
.PARAMETER Name
Name of the VM Switch.
Expand Down Expand Up @@ -381,7 +381,7 @@ function Set-TargetResource

<#
.SYNOPSIS
Tests if MSFT_xVMSwitch resource state is in the desired state or not.
Tests if DSC_VMSwitch resource state is in the desired state or not.
.PARAMETER Name
Name of the VM Switch.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[ClassVersion("1.0.0.0"), FriendlyName("xVMSwitch")]
class MSFT_xVMSwitch : OMI_BaseResource
[ClassVersion("1.0.0.0"), FriendlyName("VMSwitch")]
class DSC_VMSwitch : OMI_BaseResource
{
[Key, Description("Name of the VM Switch")] String Name;
[Key, Description("Type of switch"), ValueMap{"External","Internal","Private"}, Values{"External","Internal","Private"}] String Type;
Expand Down
File renamed without changes.

0 comments on commit 5b69372

Please sign in to comment.